To_date Error

Hi,

After a ruby upgrade I have an error with to_date.

C:>ruby Test_todate.rb
Test_todate.rb:7:in <main>': undefined methodto_date’ for
“2011-01-01”:String (NoMethodError)

Any advice ?

code is here

require ‘rubygems’
require ‘active_support’

t = Time.now

if ( t > “2011-01-01”.to_date )
end

On Mon, Nov 15, 2010 at 9:06 AM, Henrik Ekenberg
[email protected] wrote:

code is here

require ‘rubygems’
require ‘active_support’

t = Time.now

if ( t > “2011-01-01”.to_date )
end

16:49:38 $ ruby19 -e ‘p(Time.now > Time.local(“2011-01-01”))’
false

Cheers

robert

On Mon, Nov 15, 2010 at 3:06 AM, Henrik Ekenberg
[email protected] wrote:

Hi,

After a ruby upgrade I have an error with to_date.

C:>ruby Test_todate.rb
Test_todate.rb:7:in <main>': undefined method to_date’ for
“2011-01-01”:String (NoMethodError)

Sorry, I don’t have time to dig into an explanation, but try:
require ‘active_support/core_ext/string/conversions’