Module: ActiveSupport::ActionableError::ClassMethods

Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/actionable_error.rb

Instance Method Summary collapse

Instance Method Details

#action(name, &block) ⇒ Object

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


43
44
45
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.4/lib/active_support/actionable_error.rb', line 43

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