Exception: ActiveRecord::PendingMigrationError

Inherits:
MigrationError show all
Includes:
ActiveSupport::ActionableError
Defined in:
lib/active_record/migration.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(message = nil) ⇒ PendingMigrationError

Returns a new instance of PendingMigrationError.



138
139
140
141
142
143
144
145
146
# File 'lib/active_record/migration.rb', line 138

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