I like the idea because I’ve also suffered with this problem before.
What about passing the class as the second argument like in serialize?
class Monkey < ActiveRecord::Base
attr_virtual :birth_date, Date
Keep up to date with Rails on Twitter and This Week in Rails
Policies: Conduct, License, Maintenance, Security, Trademarks