confirming works, last address is now persisted, thank you page is up but not yet accessible
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
class DeliveryDestination < ActiveRecord::Base
|
||||
has_one :cart
|
||||
belongs_to :user
|
||||
|
||||
def self.find_or_create(anonymous_id, user_id)
|
||||
dd = DeliveryDestination.where(user_id: user_id).order("id desc").first
|
||||
dd ||= DeliveryDestination.where(anonymous_id_string: anonymous_id).order("id desc").first
|
||||
dd ||= DeliveryDestination.create!({user_id: user_id, anonymous_id_string: anonymous_id })
|
||||
return dd
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user