Rails: Object#id will be deprecated; use Object#object_id

Posted by sscirrus on Stack Overflow See other posts from Stack Overflow or by sscirrus
Published on 2010-05-29T18:54:57Z Indexed on 2010/05/29 19:02 UTC
Read the original article Hit count: 434

Hi everyone,

Very quick question. My server is warning me that line 37 will be deprecated, specifically:

#Server error:
views/projects/index.html.erb:37: warning: Object#id will be deprecated; use Object#object_id

#Views/projects/index.html.erb:
6: <% for project in @projects do %>
36: <%= project.id %>
37: <%= Matching.find_all_by_customer_id_and_project_id( @customer.id, project.id).id %>
38: <%= @customer.id %>

Here's my confusion. Line 36 project.id isn't raising a warning, so I assume the issue is that I'm calling ID on the Matching model. Why is it the case that only Matching raising an error and not customer or project? How can I rectify this in my code?

Thanks very much.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about server