migration extension helpers

This commit is contained in:
Dylan Knutson
2025-07-14 17:08:22 +00:00
parent 4933e63f31
commit c870eef9bc
4 changed files with 44 additions and 16 deletions

View File

@@ -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