Skip to Content Skip to Search
v7.1.0
module ActiveSupport::ActionableError::ClassMethods
Methods
A

Public instance methods

action(name, &block)

Permalink

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
Source code GitHub
# File activesupport/lib/active_support/actionable_error.rb, line 45
def action(name, &block)
  _actions[name] = block
end
Definition files