I love ruby's magic, but every so often you run across something that seems like a no-brainer. Here's my problem:
I'm storing a value as Time in my DB using MySQL's Time Column type. This store just the hh:mm:ss values.
Later when doing comparison's Ruby will grab this value and append 2001-01-01 hh:mm:ss UTC to it. (Record1 below was taken from my DB and is an ActiveRecord object obtained from a collection that happens to have a time attribute stored using MYSQL's Time function)
So it appears that my only option for useful comparions's is to use strftime? Is that right?
(ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0])
ruby-1.9.2-p290 :009 > record1.time
=> 2000-01-01 08:30:00 UTC
ruby-1.9.2-p290 :001 > time1 = "08:30:00"
=> "08:30:00"
ruby-1.9.2-p290 :002 > @time_obj1 = Time.parse time1
=> 2012-01-27 08:30:00 -0700
ruby-1.9.2-p290 :003 > @time_obj1.to_s
=> "2012-01-27 08:30:00 -0700"
ruby-1.9.2-p290 :004 >