diff options
Diffstat (limited to 'activerecord/lib/rails')
-rw-r--r-- | activerecord/lib/rails/generators/active_record/model/model_generator.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 e07f6645f5..15aecf28ca 100644 --- a/activerecord/lib/rails/generators/active_record/model/model_generator.rb +++ b/activerecord/lib/rails/generators/active_record/model/model_generator.rb @@ -43,7 +43,11 @@ module ActiveRecord end def determine_default_parent_class - if File.exist?('app/models/application_record.rb') + application_record = nil + + in_root { application_record = File.exist?('app/models/application_record.rb') } + + if application_record "ApplicationRecord" else "ActiveRecord::Base" |