module ActiveSupport::ActionableError::ClassMethods

Public Instance Methods

action(name, &block) Show source
# File activesupport/lib/active_support/actionable_error.rb, line 43
def action(name, &block)
  _actions[name] = block
end

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

© 2004–2019 David Heinemeier Hansson
Licensed under the MIT License.