That made no difference...Any more ideas? On Thu, Sep 11, 2008 at 11:13 PM, Presario 6331RSH HAM <[EMAIL PROTECTED]>wrote:
> > > > > > Observe that when I create a User with the credit_card = "1234 1234 1234 > > 1234" (format #2), the validates_uniqueness_of doesn't work. The > samething > > happens when I use format #1, but with format #3 it works! > > I think that before_save and before_create callbacks are running after > the > > validates_uniqueness_of :credit_card. > > I think you mean that the callbacks are running before the validation. > I am having the same problem. > I enter user = User.new(:name => "unique", :credit_card => "usedbefore > number") > and it gets saved because the callbacks have converted it to format#3 > so therefore it is unique now. > Will changing the order of > > validates_uniqueness_of :credit_card, > :message => "The credit card is not unique." > > and > > ...callbacks > > make any difference? > > > > -- --------------------------------------------------------------------------- Daniel Almeida Freire --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ruby-on-rails-programming-with-passion" group. To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---
