Sluggable
Creates a shortcut alias for find_by_(name|slug|key) as [] so that you can call MyModel and it will find it. A possible usage would be for common queries like User.find_by_email. The setup would be
Class User < ActiveRecord::Base
include Sluggable
sluggit! :email
end
User['[email protected]'] #=> User.find_by_email('[email protected]')
Installation
gem install sluggable
Notes
Relies on the class responding to find_by_(foo)