validates_presence_of :user_id only tests that there is a value for user_id
with this method, user_id could be any integer, not necessarily a valid user. validates_presence_of :user will also check that the user is a valid record on the database. That clear it up? > so if the user id is nil, then there is no error? > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

