Possible Duplicate:
Rails primary key and object id
On my local development rails environment, I am able to check the output from a SOAP call just fine.
I can use response.id to get the value from this packet displayed using the .inspect method:
#<SOAP::Mapping::Object:0x15702d0c0604 {}id="dd26ce5f-0cfd-9bbb-3485-4c64c9d6378
4" {}error=#<SOAP::Mapping::Object:0x15702d0bf6f0 {}number="0" {}name="No Error"
{}description="No Error">>
HOWEVER, when I push it up to heroku, I get this error:
/disk1/home/slugs/212074_6b040a6_5c2e/mnt/app/controllers/sugarcrm_controller.rb
:77: warning: Object#id will be deprecated; use Object#object_id
Driving me crazy to understand the discrepancy.
Suggestions?
I believe you may have a bug in your code, which is why that warning is thrown.
Object#idis most often invoked when you are inadvertently callingidon an object you weren’t expecting, likenil:If the object has an
idmethod, a warning is not thrown. So, assuming it works locally (and this SOAP object does have anidmethod), the only way you should be getting this warning is if it is a different kind of object.Thus, are you absolutely sure the object you expected is being returned? Try adding:
Or add some explicit error handling / object checking:
At least then you will know something has gone wrong.