Permalink
Browse files

Update instantiate_collection

  • Loading branch information...
1 parent 6bdd72c commit 3cfa36e6c71622d6a18e49ffc15f7b542bd25545 @denzel-morris denzel-morris committed Feb 6, 2013
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/active_resource/base.rb
@@ -983,10 +983,10 @@ def find_single(scope, options)
end
def instantiate_collection(collection, original_params = {}, prefix_options = {})
- parser = collection_parser.new(collection)
- parser.resource_class = self
- parser.original_params = original_params
- parser.collect! { |record| instantiate_record(record, prefix_options) }
+ collection_parser.new(collection).tap do |parser|
+ parser.resource_class = self
+ parser.original_params = original_params
+ end.collect! { |record| instantiate_record(record, prefix_options) }
end
def instantiate_record(record, prefix_options = {})

0 comments on commit 3cfa36e

Please sign in to comment.