fixed problem with multiple carts and a whole load of problems with crazy delivery destination logic / if I didn't write it i would have thought it was written by a drug abuser during high

This commit is contained in:
Senad Uka
2015-03-14 08:17:06 +01:00
parent e7793f0884
commit 8815267a79
12 changed files with 195 additions and 25 deletions

View File

@@ -2,5 +2,6 @@ class Cart < ActiveRecord::Base
has_many :item_in_carts
belongs_to :user
belongs_to :delivery_destination
end

View File

@@ -6,7 +6,7 @@ class ItemInCart < ActiveRecord::Base
validates :item_id, presence: true
validates :cart_id, presence: true
def to_s
def name
item.name + " " + count.to_s + " " + price.to_s
end
end