aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-11-13 23:03:43 -0800
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-11-13 23:03:43 -0800
commit93999edfd1a8818edc8ce7fa91b2de55edd7ec32 (patch)
treedf8307a1abdedb56660600aa09d091c053258774 /activerecord
parent02f17778b65dbd30e10cc657863a065386985362 (diff)
parent524d4a35d2893396ba0d57b5eea853b11d5a57b9 (diff)
downloadrails-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.rb6
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