Displaying 2 results from an estimated 2 matches for "minus_without_dur".
2009 Jan 23
3
Bug regarding ActiveRecord and TimeWithZone
...e.now
=> Fri, 23 Jan 2009 12:02:00 CET +01:00
>> d1.class
=> ActiveSupport::TimeWithZone
>> d2.class
=> ActiveSupport::TimeWithZone
>> d2 - d1
=> Thu Aug 04 17:50:03 UTC 1977
>> d1 - d2
TypeError: expected numeric or date
from /usr/lib/ruby/1.8/date.rb:1252:in `minus_without_duration''
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/core_ext/date/calculations.rb:88:in
`-''
from
/usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/time_with_zone.rb:201:in
`-''
from (irb):11
---------------------------------...
2009 Feb 04
4
Rails 2.2.2 to_date and to_datetime methods
In the console I see this behaviour:
>> "19270412000000".to_date.methods
=> ["ns?", "mon", "ago", "end_of_month", "months_since",
"default_inspect", "minus_without_duration", ...
>> "19270412000000".to_date.class
=> Date
>> "19270412000000".class
=> String
>> String.to_date.methods
NoMethodError: undefined method `to_date'' for String:Class
from (irb):23
Can someone explain how a method may be pres...