Sha256: 42f3900546de81418d51b1894e0bc5593af091411850290e2e0977f25e725ac0
Contents?: true
Size: 975 Bytes
Versions: 4
Compression:
Stored size: 975 Bytes
Contents
# frozen_string_literal: true require_relative '../operation' module LedgerSync module Domains class Operation class Remove include LedgerSync::Domains::Operation::Mixin private def operate return failure('Resource not found') unless resource if resource.destroy success else failure( 'Please review the problems below:', data: serialize(resource: resource) ) end end def resource @resource ||= resource_class.find_by(id: params[:id]) end def success super( true ) end def failure(message, data: nil) super( LedgerSync::Error::OperationError.new( operation: self, message: message, response: data ) ) end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems