single method for updating cart item state / fixed problems with sinatra contrib

This commit is contained in:
Senad Uka
2015-02-07 07:52:32 +01:00
parent c515e400e7
commit a642cb55eb
7 changed files with 39 additions and 21 deletions

View File

@@ -1,2 +1,8 @@
class ItemInCart < ActiveRecord::Base
belongs_to :cart
belongs_to :item
validates_uniqueness_of :item_id, scope: :cart_id
validates :item_id, presence: true
validates :cart_id, presence: true
end