single method for updating cart item state / fixed problems with sinatra contrib
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user