We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compose
class DummyInteraction < ActiveInteraction::Base integer :integer_param validates :integer_param, numericality: { geater_than: 0 } def execute unless integer_param > 10 errors.add(:integer_param, :invalid) end end end class DummyWithcompose < ActiveInteraction::Base integer :integer_param set_callback :execute, :after, :log_errors, if: -> { errors.any? } private: def execute compose(DummyInteraction, integer_param: integer_param) end def log_errors error_msg = errors.full_messages.to_sentence Rails.logger.info( "Interaction #{self.class.name} failed: '#{error_msg}'" ) end end
The following command fails but does not log the issue:
DummyWithcompose.run(integer_param: 0)
The text was updated successfully, but these errors were encountered:
27124b6
AaronLasseigne
No branches or pull requests
The following command fails but does not log the issue:
The text was updated successfully, but these errors were encountered: