[rspec-users] Q: object.id is deprecated. How to mock?

Mark Wilden mark at mwilden.com
Tue Nov 25 15:31:20 EST 2008

On Tue, Nov 25, 2008 at 11:04 AM, s.ross <cwdinfo at gmail.com> wrote:

> In Rails, the primary key, by default 'id', is used all over the
> place. However, Ruby now deprecates the use of constructs like:
> @post = Post.find(:first)
> @post_id = @post.id

These are different methods. Object#id is indeed deprecated, but
ActiveRecord::Base#id is perfectly fine.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081125/b94c45f4/attachment.html>

More information about the rspec-users mailing list