This project is archived and is in readonly mode.

#6446 new
Raymond Gao

ActiveResource::Base class is defective

Reported by Raymond Gao | February 18th, 2011 @ 04:22 AM

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,

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages