Sha256: 6ef943625580ceb20f095ad2f6c736eafa9fd40dc1354b9d91ef538300f6d7b7
Contents?: true
Size: 557 Bytes
Versions: 55
Compression:
Stored size: 557 Bytes
Contents
module ShopifyAPI class CustomCollection < Base include Events include Metafields def products Product.find(:all, :params => {:collection_id => self.id}) end def add_product(product) Collect.create(:collection_id => self.id, :product_id => product.id) end def remove_product(product) collect = Collect.find(:first, :params => {:collection_id => self.id, :product_id => product.id}) collect.destroy if collect end end end
Version data entries
55 entries across 55 versions & 2 rubygems