Files
sx-fc/app/models/payment_method_setting.rb
2019-12-18 15:05:28 +06:30

24 lines
532 B
Ruby
Executable File

class PaymentMethodSetting < ApplicationRecord
# validations
validates_presence_of :payment_method , :gateway_communication_type #, :gateway_url, :auth_token, :merchant_account_id
def self.cash_exist
temp = PaymentMethodSetting.where(payment_method: "Cash", is_active: true)
if temp.present?
return true
else
return false
end
end
def self.credit_exist
temp = PaymentMethodSetting.where(payment_method: "Credit", is_active: true)
if temp.present?
return true
else
return false
end
end
end