Exception: ActiveRecord::PendingMigrationError

Inherits:
MigrationError show all
Defined in:
activerecord/lib/active_record/migration.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ PendingMigrationError

Returns a new instance of PendingMigrationError.


128
129
130
131
132
133
134
135
136
# File 'activerecord/lib/active_record/migration.rb', line 128

def initialize(message = nil)
  if !message && defined?(Rails.env)
    super("Migrations are pending. To resolve this issue, run:\n\n        bin/rails db:migrate RAILS_ENV=#{::Rails.env}")
  elsif !message
    super("Migrations are pending. To resolve this issue, run:\n\n        bin/rails db:migrate")
  else
    super
  end
end