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.
Rob N. (Guest)
on 2009-02-20 13: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.
Frederick C. (Guest)
on 2009-02-20 14:33
(Received via mailing list)
On 20 Feb 2009, at 11:18, Rob N. 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
MaD (Guest)
on 2009-02-20 14:34
(Received via mailing list)
fractional years are no longer respected. convert to integers and use
this instead:
ActiveSupport::CoreExtensions::Integer::Time
Rob N. (Guest)
on 2009-02-20 15:52
Frederick C. 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.