Forum: Ruby on Rails Years gone by (deprecation of years method)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
09e6ba06911a5781c04be8554f114aba?d=identicon&s=25 Rob Nichols (reggieb)
on 2009-02-20 12:18
Can anyone give me some insight as to why the
ActiveSupport::CoreExtensions::Float::Time method 'years' is being
deprecated? I have an application managing contracts and being able to
manipulate and report on them based on the number of years the contract
lasts, is very convenient.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-02-20 13:33
(Received via mailing list)
On 20 Feb 2009, at 11:18, Rob Nichols wrote:

>
> Can anyone give me some insight as to why the
> ActiveSupport::CoreExtensions::Float::Time method 'years' is being
> deprecated? I have an application managing contracts and being able to
> manipulate and report on them based on the number of years the
> contract
> lasts, is very convenient.

It's to do with
http://groups.google.com/group/rubyonrails-core/br...

These methods used to be on Numeric, but did weird things with floats,
so they were pulled out of Numeric and now only exist (in actual form)
on Integer.

Fred
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-02-20 13:34
(Received via mailing list)
fractional years are no longer respected. convert to integers and use
this instead:
ActiveSupport::CoreExtensions::Integer::Time
09e6ba06911a5781c04be8554f114aba?d=identicon&s=25 Rob Nichols (reggieb)
on 2009-02-20 14:52
Frederick Cheung wrote:

> It's to do with
> 
http://groups.google.com/group/rubyonrails-core/br...
>
> These methods used to be on Numeric, but did weird things with floats,
> so they were pulled out of Numeric and now only exist (in actual form)
> on Integer.

Thank you - just the information I was looking for.
This topic is locked and can not be replied to.