added custom-name to generator to avoid uninitialized constant error
This commit is contained in:
parent
fc8b5efaa8
commit
673b6f7aba
|
@ -12,7 +12,7 @@ module ActiveRecord
|
|||
|
||||
def copy_aasm_migration
|
||||
if model_exists?
|
||||
migration_template "migration_existing.rb", "db/migrate/add_aasm_state_to_#{table_name}.rb"
|
||||
migration_template "migration_existing.rb", "db/migrate/add_#{column_name}_to_#{table_name}.rb"
|
||||
else
|
||||
migration_template "migration.rb", "db/migrate/aasm_create_#{table_name}.rb"
|
||||
end
|
||||
|
|
|
@ -36,4 +36,9 @@ describe ActiveRecord::Generators::AASMGenerator, type: :generator do
|
|||
assert_migration "db/migrate/add_aasm_state_to_jobs.rb"
|
||||
end
|
||||
|
||||
it "add custom aasm_column in existing model" do
|
||||
run_generator %w(job state)
|
||||
assert_migration "db/migrate/add_state_to_jobs.rb"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue