In almost every my project there is a model that refers to myself. It can be an instance of User, Staff, Admin, Dude, etc. I use it for logging in and testing staff. I use it many times in rails console as well. Because typing User.where(:email => '[email protected]').first
can by annoying so I've put together little snippet that work in Mongoid and AcitveRecord as well.
$ rails console
Loading development environment (Rails 3.1.0.rc4)
>> load 'me.rb'
=> nil