Skip to content

Commit

Permalink
Make sure File.exist? run in the root of the application
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Dec 16, 2015
1 parent 7ed68b1 commit 342221b
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -43,7 +43,11 @@ def parent_class_name
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"
Expand Down

2 comments on commit 342221b

@jeremy
Copy link
Member

@jeremy jeremy commented on 342221b Dec 16, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@gsamokovarov
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.