diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-11-13 23:03:43 -0800 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-11-13 23:03:43 -0800 |
commit | 93999edfd1a8818edc8ce7fa91b2de55edd7ec32 (patch) | |
tree | df8307a1abdedb56660600aa09d091c053258774 /activerecord | |
parent | 02f17778b65dbd30e10cc657863a065386985362 (diff) | |
parent | 524d4a35d2893396ba0d57b5eea853b11d5a57b9 (diff) | |
download | rails-93999edfd1a8818edc8ce7fa91b2de55edd7ec32.tar.gz rails-93999edfd1a8818edc8ce7fa91b2de55edd7ec32.tar.bz2 rails-93999edfd1a8818edc8ce7fa91b2de55edd7ec32.zip |
Merge pull request #12845 from amatsuda/should_ar_depend_on_rails
Refer to Rails.env from AR only when Rails is defined
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 5224a6b67c..d010f23517 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -32,7 +32,11 @@ module ActiveRecord 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 |