Skip to content

Commit

Permalink
[ETX-2221] Rails 7.2 support - migrations_paths can vary
Browse files Browse the repository at this point in the history
  • Loading branch information
mmurphy-notarize committed Sep 13, 2024
1 parent 81825cd commit dd00c84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/generators/data_migration_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class DataMigrationGenerator < Rails::Generators::NamedBase

def create_migration_file
migration_file_name =
"#{RailsDataMigrations::Migrator.migrations_path}/#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{file_name}.rb"
"#{RailsDataMigrations::Migrator.migrations_paths.first}/#{Time.now.utc.strftime('%Y%m%d%H%M%S')}_#{file_name}.rb"
copy_file 'data_migration_generator.rb', migration_file_name do |content|
content.sub(/ClassName/, file_name.camelize)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
RailsDataMigrations::LogEntry.delete_all

# stub migrations folder
allow(RailsDataMigrations::Migrator).to receive(:migrations_path).and_return('spec/db/data-migrations')
allow(RailsDataMigrations::Migrator).to receive(:migrations_paths).and_return(['spec/db/data-migrations'])

# remove migration files
`rm -rf spec/db/data-migrations`
Expand Down

0 comments on commit dd00c84

Please sign in to comment.