Skip to navigation

Thu May 10th

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.

Scrapbook

toolmantim

I’m Tim Lucas, a user experience developer and maker of things.

I occasionally write, snap photos, present on various technical topics, tweet my going-ons, share teh codes and post tidbits to this scrapbook.

Work with me via Agency Rainford, or find my email on toolmantim.com and say hello.

Powered by tumblr.com