I've got a patch working for this and wanted to know the core-team's
opinion on this feature-add. I often find myself wanting to do finds
with id's and having the natural urge do to this.
User[12] #=> User.find(12)
Asking the User < ActiveRecord::Base object to give me an "index" on
it... aka, the primary key... aka, the id.
Any interest in this as a nice little shorthand? I'm asking here
before making an actual-patch because I know that changes to
ActiveRecord API are serious and I wanted to get opinions first.
For example, I use a plugin called "acts_as_lookup" in which you can
do things like State["NY","California"] and State[5] where it will
return the matching records.
IMHO defining the method on AR objects should be done in plugins,
or it should be gone all out with configurability options.