Piggy-backed attributes are one way to cut down on the size of queries.
ActiveRecord
Piggy-backed attributes are one way to cut down on the size of queries.
Unfortunately, while this may have once worked, it doesn't work now. Or at least doesn't work when using Ruby-DBI. The timestamps are parsed too early in the stack for custom accessors to make a difference. By the time the accessors see the values they have already been converted to DateTime objects in @attributes.
Date uses Rational heavily, which calls Integer#gcd for every new Rational. The Integer#gcd method is generic to handle Bignums, but performs terribly for Fixnum#gcd(Fixnum), which is probably the most often case.