From: Daniel DeLorme Date: 2007-08-23T06:58:52+09:00 Subject: Re: time class changed in ruby-1.8.6? Florian Frank wrote: > Ball, Donald A Jr (Library) wrote: >> Hi guys. I'm in the process of migrating a ruby app from 1.8.5 to 1.8.6 >> and noticed that the Time class seems to have changed. > > I think the whole date implemetation was substituted by a new > implementation (date2), which isn't fully compatible to the old one. Now > Time#to_date, which is mixed in from file date.rb, is a private method. > You could __send__ :to_date to your Time object. I have now idea why it > is private now. Why aren't all three to_* methods defined in all Time, > Date, and DateTime classes? This would make converting between different > time objects much easier. You're probably using rails. Ruby used to *not* have a Time#to_date method but now it has one which is private. And the to_date helper added by rails is further up the call chain and therefore gets hidden by the private method, so that's what you get. :-/ Add one of the following in your environment.rb: class Time; public :to_date ;end #use the ruby-1.8.6 version class Time; remove_method :to_date ;end #use the rails version Daniel