Permalink
Browse files

Merge pull request #12845 from amatsuda/should_ar_depend_on_rails

Refer to Rails.env from AR only when Rails is defined
  • Loading branch information...
2 parents 02f1777 + 524d4a3 commit 93999edfd1a8818edc8ce7fa91b2de55edd7ec32 @guilleiguaran guilleiguaran committed Nov 14, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 activerecord/lib/active_record/migration.rb
@@ -32,7 +32,11 @@ def initialize(name)
class PendingMigrationError < ActiveRecordError#:nodoc:
def initialize
- super("Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=#{::Rails.env}' to resolve this issue.")
+ if defined?(Rails)
+ super("Migrations are pending; run 'bin/rake db:migrate RAILS_ENV=#{::Rails.env}' to resolve this issue.")
+ else
+ super("Migrations are pending; run 'bin/rake db:migrate' to resolve this issue.")
+ end
end
end

0 comments on commit 93999ed

Please sign in to comment.