From: Brian Candler Date: 2011-01-04T23:44:06+09:00 Subject: Re: Validates is exists Jose tomas R. wrote in post #972073: > Event has_and_belongs_to_many :users > User has_and_belongs_to_many :events > > Im trying to verify that user doesnt signup more than one time ... > if @event.users.find(@user) != @user.id Foo.find(x) looks for a record with id X, and will raise an exception if it doesn't exist, as you already discovered. Completely untested, but you could try some variation of if @event.users.find_by_id(@user.id) if @event.users.where(:id => @user.id).count > 0 -- Posted via http://www.ruby-forum.com/.