Sha256: 90b71710cbe69864b2b9529430da2ebde522cc658ff09923781c5c6d7c38d896

Contents?: true

Size: 303 Bytes

Versions: 3

Compression:

Stored size: 303 Bytes

Contents

module Metaractor
  module FailFromContext
    def fail_from_context(context:)
      return if context.equal?(self)

      invalidate! if context.invalid?
      add_errors(messages: context.errors)
      @failure = true
    end
  end
end

Interactor::Context.send(:include, Metaractor::FailFromContext)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
metaractor-1.2.1 lib/metaractor/fail_from_context.rb
metaractor-1.2.0 lib/metaractor/fail_from_context.rb
metaractor-1.1.0 lib/metaractor/fail_from_context.rb