Displaying 1 result from an estimated 1 matches for "to_t".
Did you mean:
to_s
2006 Mar 10
0
Need an opinion on ActiveRecord vs.(?) duck typing
...ack to a Time object by ActiveRecord. The problem happens when I need
to compare this ActiveRecord-converted Time object to a client-created
DateTime object. The == method simply returns false, always.
To get rid of the problem, the first solution I have thought of (and
implemented) is to insert a to_t method in the both classes, in order
to convert to a Time object. With this, every comparation I do after
the conversion. That way I am effectively comparing two Time objects
and the comparison is done correctly.
But that solution limits the number of classes my clients can insert
on the date fiel...