rails/rails — pull request #3531 by avakhov (2011-11-05 18:09:33+00:00)
Title: distance_of_time_in_words should correct process time periods longer than 1 year defined in seconds

It differs from #3530 :)

Here I fix side an effect after ae7d0d816db3f9a94008d36ab9efbe7583700981 also.

distance_of_time_in_words accepts args as integer (seconds), Date, Time, DateTime or something that responds to :to_time method. If from_time and to_time are seconds for periods more than 1 year [date_helper.rb#L97](https://github.com/rails/rails/blob/ae7d0d816db3f9a94008d36ab9efbe7583700981/actionpack/lib/action_view/helpers/date_helper.rb#L97) is interpreted as [ActiveSupport year method](http://api.rubyonrails.org/classes/Integer.html#method-i-year). In this case creating Range object (fyear..tyear) failes.

I did change nothing in [date_helper.rb#L97-110](https://github.com/rails/rails/blob/ae7d0d816db3f9a94008d36ab9efbe7583700981/actionpack/lib/action_view/helpers/date_helper.rb#L97-110) except indent.