migration extension helpers
This commit is contained in:
@@ -28,21 +28,18 @@ RSpec.describe ActiveRecord::AuxTable do
|
||||
before(:all) do
|
||||
# Set up the database schema for testing
|
||||
ActiveRecord::Schema.define do
|
||||
create_table :vehicles do |t|
|
||||
t.string :type, null: false
|
||||
create_base_table :vehicles do |t|
|
||||
t.string :name
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_aux_table :vehicles, :car do |t|
|
||||
t.string :fuel_type
|
||||
t.decimal :engine_size, precision: 3, scale: 1
|
||||
t.timestamps
|
||||
end
|
||||
t.create_aux :car do |t|
|
||||
t.string :fuel_type
|
||||
t.decimal :engine_size, precision: 3, scale: 1
|
||||
end
|
||||
|
||||
create_aux_table :vehicles, :boat do |t|
|
||||
t.string :boat_type
|
||||
t.timestamps
|
||||
t.create_aux :boat do |t|
|
||||
t.string :boat_type
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user