I'd be putting this:

def username=(value)
  write_attribute(:username, value.upcase)
end

in my controller right?  Sorry for the beginning questions...


On Mar 5, 11:12 am, Michael Pavling <[email protected]> wrote:
> On 5 March 2010 16:05, Andy Jeffries <[email protected]> wrote:
>
> >> 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! ;-)
>
> Or change the setter (rather than messing around with filters ;-)
>
> def username=(value)
>   write_attribute(:username, value.upcase)
> end

-- 
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.

Reply via email to