Method: OneMoreTime::IdempotentRequest#success
- Defined in:
- lib/one_more_time/idempotent_request.rb
#success ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/one_more_time/idempotent_request.rb', line 29 def success ActiveRecord::Base.transaction do result = yield if block_given? attrs = @success_attributes_block&.call(result) || {} update_and_unlock(attrs) end rescue StandardError => exception failure!(exception: exception) end |