Merge pull request #12845 from amatsuda/should_ar_depend_on_rails

Refer to Rails.env from AR only when Rails is defined
This commit is contained in:
Guillermo Iguaran 2013-11-13 23:03:43 -08:00
commit 93999edfd1

@ -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