Skip to content
Browse files

Use the new_with_client class method when creating instances of the s…

…ub-resource class
  • Loading branch information...
1 parent a5fbbc7 commit 00ac5c8e30eb23753bf077108344a6ca73dd0e11 @timcraft timcraft committed Sep 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/gocardless/resource.rb
View
2 lib/gocardless/resource.rb
@@ -27,7 +27,7 @@ def initialize(hash = {})
query = default_query.merge(args.first || {})
client.api_get(path, query).map do |attrs|
# Convert the results to instances of the looked-up class
- klass.new(attrs).tap { |m| m.client = client }
+ klass.new_with_client(client, attrs)
end
end
end

0 comments on commit 00ac5c8

Please sign in to comment.
Something went wrong with that request. Please try again.