Forum: Ruby on Rails Model, controller or view - where to normalize data?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
James B. (Guest)
on 2008-12-18 16:58
I have a login screen and I wish to normalize the login name for the
purposes of INSERT and SELECT.  In the model I have:

  def username=(name)
    # keycase is a local extension of class String.
    write_attribute(:username, name.keycase)

The attribute username of an new user is indeed stored as a normalized
string.  However, when logging on and I input the username in capital
letters then the select fails, because the param value of username is
not normalized.  The question is, where do I perform this manipulation
for the login?  In the controller?  In the view?  Or is there a way to
accomplish this in the model?
This topic is locked and can not be replied to.