123456789_123456789_123456789_123456789_123456789_

Module: ActiveSupport::ActionableError::ClassMethods

Relationships & Source Files
Defined in: activesupport/lib/active_support/actionable_error.rb

Instance Method Summary

Instance Method Details

#action(name, &block)

Defines an action that can resolve the error.

class PendingMigrationError < MigrationError
  include ActiveSupport::ActionableError

  action "Run pending migrations" do
    ActiveRecord::Tasks::DatabaseTasks.migrate
  end
end
[ GitHub ]

  
# File 'activesupport/lib/active_support/actionable_error.rb', line 45

def action(name, &block)
  _actions[name] = block
end