overide’n dynamic finders
class User < ActiveRecord::Base
def self.find_by_email(email, *opts)
with_scope(:find => { :conditions => ['lower(email) = lower(?)', email] }) do
find(:first, *opts)
end
end
end
update: this seems to have caused quite the stir. Obviously some people are missing the point, so I’ve posted a wee article about it.