diff options
Diffstat (limited to 'activerecord/lib/rails')
3 files changed, 8 insertions, 16 deletions
diff --git a/activerecord/lib/rails/generators/active_record/migration.rb b/activerecord/lib/rails/generators/active_record/migration.rb index 4263c11ffc..43075077b9 100644 --- a/activerecord/lib/rails/generators/active_record/migration.rb +++ b/activerecord/lib/rails/generators/active_record/migration.rb @@ -20,6 +20,14 @@ module ActiveRecord key_type = options[:primary_key_type] ", id: :#{key_type}" if key_type end + + def db_migrate_path + if defined?(Rails) && Rails.application + Rails.application.config.paths["db/migrate"].to_ary.first + else + "db/migrate" + end + end end end end diff --git a/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb b/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb index c2ae21b4b2..1f1c47499b 100644 --- a/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb +++ b/activerecord/lib/rails/generators/active_record/migration/migration_generator.rb @@ -71,14 +71,6 @@ module ActiveRecord def normalize_table_name(_table_name) pluralize_table_names? ? _table_name.pluralize : _table_name.singularize end - - def db_migrate_path - if defined?(Rails) && Rails.application - Rails.application.config.paths["db/migrate"].to_ary.first - else - "db/migrate" - end - end end end end diff --git a/activerecord/lib/rails/generators/active_record/model/model_generator.rb b/activerecord/lib/rails/generators/active_record/model/model_generator.rb index b26ad42859..5cec07d2e3 100644 --- a/activerecord/lib/rails/generators/active_record/model/model_generator.rb +++ b/activerecord/lib/rails/generators/active_record/model/model_generator.rb @@ -64,14 +64,6 @@ module ActiveRecord "app/models/application_record.rb" end end - - def db_migrate_path - if defined?(Rails) && Rails.application - Rails.application.config.paths["db/migrate"].to_ary.first - else - "db/migrate" - end - end end end end |