Sha256: ffba2cf55f15ef0df5a9271d09082e7b21255e22c6809092351a695ebe52fd85

Contents?: true

Size: 389 Bytes

Versions: 5

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Service
    module Plugins
      module WrapsResultInDbTransaction
        class Middleware < MethodChainMiddleware
          intended_for :result, scope: :class, entity: :service

          def next(...)
            ::ActiveRecord::Base.transaction { chain.next(...) }
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
convenient_service-0.17.0 lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb
convenient_service-0.16.0 lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb
convenient_service-0.15.0 lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb
convenient_service-0.14.0 lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb
convenient_service-0.13.0 lib/convenient_service/service/plugins/wraps_result_in_db_transaction/middleware.rb