class SpiffyStoresAPI::StandardCollection
Public Instance Methods
add_product(product)
click to toggle source
# File lib/spiffy_stores_api/resources/standard_collection.rb, line 9 def add_product(product) Collect.create(:collection_id => self.id, :product_id => product.id) end
products()
click to toggle source
# File lib/spiffy_stores_api/resources/standard_collection.rb, line 5 def products Product.find(:all, :params => {:collection_id => self.id}) end
remove_product(product)
click to toggle source
# File lib/spiffy_stores_api/resources/standard_collection.rb, line 13 def remove_product(product) collect = Collect.find(:first, :params => {:collection_id => self.id, :product_id => product.id}) collect.destroy if collect end