Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveResource::Base class is defective #854

Closed
lighthouse-import opened this issue May 16, 2011 · 0 comments
Closed

ActiveResource::Base class is defective #854

lighthouse-import opened this issue May 16, 2011 · 0 comments

Comments

@lighthouse-import
Copy link

Imported from Lighthouse. Original ticket at: http://rails.lighthouseapp.com/projects/8994/tickets/6446
Created by Raymond Gao - 2011-02-18 10:10:47 UTC

Hi, I am building a GEM for retrieving data from Salesforce Force.com using REST API.
My class inherits from the ActiveResource::Base class. However, we I tried to make a Salesforce::UserRest.find(:all) call, the ActiveResource fails and complains about 'collect!' as an invalid method.

Apparently, in the 'ActiveResource::Base' file, the line#885 of 3.0.4 version release is the culprit for failure. "collect!" is a valid method for Array. But, when you have a Hash object as the result of a REST call, it breaks the GEM, because 'collect!' is not a valid method for the Hash class.

See this:
def instantiate_collection(collection, prefix_options = {})
collection.collect! { |record| instantiate_record(record, prefix_options) } #This is the problem line.
end

Can someone please fix this?
Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant