# Object#id will be deprecated

**URL:** <https://www.ruby-forum.com/t/object-id-will-be-deprecated/108007>\
**Category:** Rails\
**Created:** [June 28, 2007, 11:00am UTC](https://www.ruby-forum.com/t/object-id-will-be-deprecated/108007 "2007-06-28T11:00:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [June 28, 2007, 11:00am UTC](https://www.ruby-forum.com/t/object-id-will-be-deprecated/108007/1 "2007-06-28T11:00:15Z")

</div>

I see this warning in my log

…/app/models/user.rb:179: warning: Object#id will be deprecated; use  
Object#object\_id

I am using in my user model ‘self.id’ to the mysql record id of the  
user which gives me correctly 25

the self.object\_id is not the sql record id…

… whta’s the right writing ??

thanks

kad

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [June 28, 2007, 11:23am UTC](https://www.ruby-forum.com/t/object-id-will-be-deprecated/108007/2 "2007-06-28T11:23:55Z")

</div>

Kad K. wrote:

> I see this warning in my log
> 
> …/app/models/user.rb:179: warning: Object#id will be deprecated; use  
> Object#object\_id

Usually this error occurs when you call id on something that isn’t an  
ActiveRecord::Base object. Check all possible calls of #id at line 179  
of user.rb. Then insert “puts object.class.name” debug statement for  
each object on which you call id to verify the actual class.

Lionel
