Module: RailsTrade::PaymentReference

Extended by:
ActiveSupport::Concern
Included in:
PaymentReference
Defined in:
app/models/rails_trade/payment_reference.rb

Instance Method Summary collapse

Instance Method Details

#prevent_duplicateObject



12
13
14
15
16
# File 'app/models/rails_trade/payment_reference.rb', line 12

def prevent_duplicate
  if PaymentReference.exists?(payment_method_id: self.payment_method_id, buyer_id: self.buyer_id, buyer_type: self.buyer_type)
    throw(:abort)
  end
end