On 2008-11-25, at 14:04, s.ross 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

..snip..

Thanks,

Steve

Hi Steve. Ruby deprecated Object#id in favour of Object#object_id . Now it's possible to obtain the ActiveRecord "id" and Object "id" for an ActiveRecord object:
  @foo = Foo.find :first
  @foo.id               # => 3
  @foo.object_id  # => 20613620

I hope that clears up your question. Cheers,
Nick
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to