> > >> 2. regardless of what they enter in the field (uppercase or lowercase) > >> I need to convert the username value to uppercase before it's stored > > > > self.username.downcase! > > erm... upcase! ;-) >
Doh :-) > Or change the setter (rather than messing around with filters ;-) > > def username=(value) > write_attribute(:username, value.upcase) > end > Is the setter called if you assign to the attributes hash (e.g. with new or create)? I guess it must be, but I'd generally put that in a callback to be sure :-) Cheers, Andy -- 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.

