Permalink
Browse files

Check if APP_RAKEFILE is defined

  • Loading branch information...
1 parent 1817c4f commit 89f558c8c6a1f04883456fca573c27b8f72d09ab @drogus drogus committed May 16, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/railtie.rb
View
2 activerecord/lib/active_record/railtie.rb
@@ -44,7 +44,7 @@ class Railtie < Rails::Railtie # :nodoc:
ActiveRecord::Tasks::DatabaseTasks.migrations_paths = Rails.application.paths['db/migrate'].to_a
ActiveRecord::Tasks::DatabaseTasks.fixtures_path = File.join Rails.root, 'test', 'fixtures'
- if engine = Rails::Engine.find(find_engine_path(APP_RAKEFILE))
+ if defined?(APP_RAKEFILE) && engine = Rails::Engine.find(find_engine_path(APP_RAKEFILE))
if engine.paths['db/migrate'].existent
ActiveRecord::Tasks::DatabaseTasks.migrations_paths += engine.paths['db/migrate'].to_a
end

1 comment on commit 89f558c

@joelcogen

Thanks for this! I just realised I had introduced a new bug and you already fixed it!

Please sign in to comment.