rails/rails — pull request #5928 by avakhov (2012-04-22 09:48:23+00:00)
Title: Use leap years trick in distance_of_time_in_words only for distances between real date points

Code trick for leap years from `distance_of_time_in_words` doesn't have meaning for time disnances in seconds:

``` ruby
# https://github.com/rails/rails/blob/master/actionpack/lib/action_view/helpers/date_helper.rb#L97-101
fyear = from_time.year
fyear += 1 if from_time.month >= 3
tyear = to_time.year
tyear -= 1 if to_time.month < 3
leap_years = (fyear > tyear) ? 0 : (fyear..tyear).count{|x| Date.leap?(x)}
```

Because `10.year` => `ActiveSupport::Duration - 10 years`. And iteration `(fyear..to_year)` raises an exception.