# Years gone by (deprecation of years method)

**URL:** <https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859>\
**Category:** Rails\
**Created:** [February 20, 2009, 12:18pm UTC](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859 "2009-02-20T12:18:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [February 20, 2009, 12:18pm UTC](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859/1 "2009-02-20T12:18:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [February 20, 2009, 1:34pm UTC](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859/2 "2009-02-20T13:34:00Z")

</div>

fractional years are no longer respected. convert to integers and use  
this instead:  
ActiveSupport::CoreExtensions::Integer::Time

---

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [February 20, 2009, 1:33pm UTC](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859/3 "2009-02-20T13:33:24Z")

</div>

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/browse\_thread/thread/e546c5a2c3d82da5/8556c83c1d028eff](http://groups.google.com/group/rubyonrails-core/browse_thread/thread/e546c5a2c3d82da5/8556c83c1d028eff)

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

---

<div class="post-metadata">

**Author:** ![reggieb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@reggieb](https://www.ruby-forum.com/u/reggieb)\
**Post date:** [February 20, 2009, 2:52pm UTC](https://www.ruby-forum.com/t/years-gone-by-deprecation-of-years-method/160859/4 "2009-02-20T14:52:20Z")

</div>

Frederick C. wrote:

> It’s to do with  
> [http://groups.google.com/group/rubyonrails-core/browse\_thread/thread/e546c5a2c3d82da5/8556c83c1d028eff](http://groups.google.com/group/rubyonrails-core/browse_thread/thread/e546c5a2c3d82da5/8556c83c1d028eff)
> 
> 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.
