I have validates_uniqueness_of :name in my model which works fine when creating a record but doesn''t work when I edit the record. In other words it won''t let me create a record with the same name but I can go in after and update the field without a problem. Why would this happen? -Mike --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
nevermind, figured it out. peace -mike On 9/2/07, mike <mikebannister-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have validates_uniqueness_of :name in my model which works fine when > creating a record but doesn''t work when I edit the record. In other > words it won''t let me create a record with the same name but I can go > in after and update the field without a problem. Why would this > happen? -Mike > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The validation was working fine. The problem was that the logic in my controller where I submitted the form to didn''t was flawed and so it didn''t indicate there had been a problem saving it. -Mike On 9/3/07, oz <bernard.collin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the idea of a forum is to share answers and ideas, so how about you > share > what was wrong and potentially help others > > oz > > On Sep 3, 4:35 am, "Michael Bannister" <mikebannis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > nevermind, figured it out. peace -mike > > > > On 9/2/07, mike <mikebannis...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > I have validates_uniqueness_of :name in my model which works fine when > > > creating a record but doesn''t work when I edit the record. In other > > > words it won''t let me create a record with the same name but I can go > > > in after and update the field without a problem. Why would this > > > happen? -Mike > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---