lib/access/favorite.rb in access-2.0.29 vs lib/access/favorite.rb in access-2.0.30
- old
+ new
@@ -18,10 +18,12 @@
def resource
self.send(self.favorite_type)
end
+ # search / index
+
def self.search(options = {})
Access::Api.new.favorites_search options
end
def self.search_offers(options = {})
@@ -34,12 +36,15 @@
def self.search_stores(options = {})
Access::Api.new.favorites_search options.merge(favorite_type: 'stores')
end
- def self.find(offer_key, options = {})
- Access::Api.new.favorites_find offer_key, options
+ # find / show
+
+ def self.find(resource_id, options = {})
+ # must pass in a favorite_type
+ Access::Api.new.favorites_find resource_id, options
end
def self.find_offer(offer_key, options = {})
Access::Api.new.favorites_find offer_key, options.merge(favorite_type: 'offers')
end
@@ -50,11 +55,14 @@
def self.find_store(store_key, options = {})
Access::Api.new.favorites_find store_key, options.merge(favorite_type: 'stores')
end
+ # create
+
def self.create(offer_key, options = {})
+ # must pass in a favorite_type
Access::Api.new.favorites_create offer_key, options
end
def self.create_offer(offer_key, options = {})
Access::Api.new.favorites_create offer_key, options.merge(favorite_type: 'offers')
@@ -65,9 +73,11 @@
end
def self.create_store(store_key, options = {})
Access::Api.new.favorites_create store_key, options.merge(favorite_type: 'stores')
end
+
+ #delete
def self.delete(offer_key, options = {})
Access::Api.new.favorites_delete offer_key, options
end