diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-16 21:29:08 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-12-16 21:29:08 -0200 |
commit | 342221b073c82ac7ebb7349da8b1d7e1ab1c4005 (patch) | |
tree | 340e647684ac17ec69d7592bdcf776dc78af3f8b /activerecord/lib/rails | |
parent | 7ed68b1611cba1de40d9da02c2325961f28aaeb1 (diff) | |
download | rails-342221b073c82ac7ebb7349da8b1d7e1ab1c4005.tar.gz rails-342221b073c82ac7ebb7349da8b1d7e1ab1c4005.tar.bz2 rails-342221b073c82ac7ebb7349da8b1d7e1ab1c4005.zip |
Make sure File.exist? run in the root of the application
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" |