Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the custom finders compatible with ActiveResource < 3

  • Loading branch information...
commit f48559ebe7dc4b3584694fb0292e46ea2bccfe21 1 parent ae511c5
@staugaard staugaard authored
View
2  lib/chargify_api_ares/resources/coupon.rb
@@ -5,7 +5,7 @@ def self.find_all_by_product_family_id(product_family_id)
end
def self.find_by_product_family_id_and_code(product_family_id, code)
- Coupon.new(get(:lookup, :product_family_id => product_family_id, :code => code), true)
+ find(:one, :from => :lookup, :params => {:product_family_id => product_family_id, :code => code})
end
def usage
View
2  lib/chargify_api_ares/resources/customer.rb
@@ -1,7 +1,7 @@
module Chargify
class Customer < Base
def self.find_by_reference(reference)
- Customer.new(get(:lookup, :reference => reference), true)
+ find(:one, :from => :lookup, :params => {:reference => reference})
end
class Subscription < Base
View
2  lib/chargify_api_ares/resources/product.rb
@@ -1,7 +1,7 @@
module Chargify
class Product < Base
def self.find_by_handle(handle)
- Product.new(get(:lookup, :handle => handle), true)
+ find(:one, :from => :lookup, :params => {:handle => handle})
end
protected
Please sign in to comment.
Something went wrong with that request. Please try again.