Gift interface added
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
class Cart < ActiveRecord::Base
|
||||
has_many :item_in_carts, -> { order "created_at" }
|
||||
belongs_to :delivery_destination
|
||||
|
||||
belongs_to :delivery_destination, :class_name => 'DeliveryDestination', :foreign_key => 'delivery_destination_id'
|
||||
belongs_to :delivery_destination, :class_name => 'DeliveryDestination', :foreign_key => 'recipient_destination_id'
|
||||
|
||||
def self.find_or_create(anonymous_id, user_id)
|
||||
cart = nil
|
||||
@@ -74,7 +76,7 @@ class Cart < ActiveRecord::Base
|
||||
|
||||
def title
|
||||
number = id
|
||||
name = delivery_destination.name
|
||||
name = delivery_destination.name
|
||||
value = Helper.money(total)
|
||||
phone = "0#{delivery_destination.phone}"
|
||||
"BR: #{number} za #{name} (#{phone}) - #{value}"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class DeliveryDestination < ActiveRecord::Base
|
||||
has_one :cart
|
||||
has_many :carts
|
||||
belongs_to :user
|
||||
|
||||
def self.create_from_last(anonymous_id, user_id)
|
||||
|
||||
Reference in New Issue
Block a user