Last used btn
This commit is contained in:
@@ -6,6 +6,7 @@ class DeliveryDestination < ActiveRecord::Base
|
||||
dd = DeliveryDestination.where(["user_id is not null and user_id = ?", user_id]).order("id desc").first
|
||||
dd ||= DeliveryDestination.where(["anonymous_id_string is not null and anonymous_id_string = ?", anonymous_id]).order("id desc").first
|
||||
dd ||= DeliveryDestination.new({user_id: user_id, anonymous_id_string: anonymous_id })
|
||||
dd.payment_method ||= "cash_on_delivery"
|
||||
attributes = dd.as_json
|
||||
attributes.delete("id")
|
||||
result = DeliveryDestination.create!(attributes)
|
||||
@@ -15,7 +16,7 @@ class DeliveryDestination < ActiveRecord::Base
|
||||
def get_payment_string
|
||||
case self.payment_method
|
||||
when 'cash_on_delivery'
|
||||
'Pouzecem'
|
||||
'Prilikom preuzimanja'
|
||||
when 'paypal'
|
||||
'Paypal'
|
||||
when 'pikpay'
|
||||
|
||||
Reference in New Issue
Block a user