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
Conflicts:
	activerecord/lib/active_record/migration.rb
  • Loading branch information...
1 parent baeb3e3 commit aae99c9a2ff96357a962d106526b4bf253ce3f03 @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 aae99c9

Please sign in to comment.