On 23 December 2011 07:07, Dharmdip Rathod <li...@ruby-forum.com> wrote: > It's not working !
It is no good just saying it is not working, what response do you expect from that? Gautam Pai suggested that you read the documentation, but four minutes later you posted your reply so I suspect you did not do that. Go back and read the documentation, check your code, try things in the rails console to try and work out what the problem is. Then if you still cannot get it to work show us the code ( just the relevant bits in the model where you specify the validation) and some results from saving records in the Rails Console that shows that it does not work. Colin > > Gomzi Pai wrote in post #1037968: >> try :scope option in your statement >> >> eg: >> >> validates :itemcode, :uniqueness => true, :scope => :user_id >> >> read the documentation here >> >> > http://api.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html#method-i-validates_uniqueness_of >> >> and section 3.10 uniqueness in >> >> http://guides.rubyonrails.org/active_record_validations_callbacks.html >> >> Gautam Pai > > -- > Posted via http://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 rubyonrails-talk@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > -- gplus.to/clanlaw -- 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 rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.