diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-06 07:27:59 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-05-06 07:27:59 -0700 |
commit | fb90ce015f5ba0919d1546a77ac65ca2c3539a74 (patch) | |
tree | d7134eb75920b1abcdd308fc891c2d73feb26f3e /actionpack/lib | |
parent | 3c01a693d9306012883f8319b476dc7f841c4d24 (diff) | |
parent | 5a6d9d54917e1311a9aef78a82313c296d821150 (diff) | |
download | rails-fb90ce015f5ba0919d1546a77ac65ca2c3539a74.tar.gz rails-fb90ce015f5ba0919d1546a77ac65ca2c3539a74.tar.bz2 rails-fb90ce015f5ba0919d1546a77ac65ca2c3539a74.zip |
Merge pull request #10406 from greenriver/distance_of_time_rational
Correct time_ago_in_words to handle situation where Fixnum#/ returns a Rational (thanks to mathn)
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/date_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb index 99aa144d3a..39b9a8d27c 100644 --- a/actionpack/lib/action_view/helpers/date_helper.rb +++ b/actionpack/lib/action_view/helpers/date_helper.rb @@ -112,7 +112,7 @@ module ActionView # english it would read better as about 80 years. minutes_with_offset = distance_in_minutes - minute_offset_for_leap_year remainder = (minutes_with_offset % 525600) - distance_in_years = (minutes_with_offset / 525600) + distance_in_years = (minutes_with_offset.div 525600) if remainder < 131400 locale.t(:about_x_years, :count => distance_in_years) elsif remainder < 394200 |