diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-11-11 18:39:43 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-11-11 18:55:06 +0900 |
commit | 524d4a35d2893396ba0d57b5eea853b11d5a57b9 (patch) | |
tree | 95e551f483a30860469ea9571f5ddbed2fc08764 /activerecord/lib/active_record | |
parent | 5b1221347d371464fbf69900deef251a9c07fbe9 (diff) | |
download | rails-524d4a35d2893396ba0d57b5eea853b11d5a57b9.tar.gz rails-524d4a35d2893396ba0d57b5eea853b11d5a57b9.tar.bz2 rails-524d4a35d2893396ba0d57b5eea853b11d5a57b9.zip |
Refer to Rails.env only when Rails is defined
Diffstat (limited to 'activerecord/lib/active_record')
-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 |