rails/rails — pull request #10406 by btucker (2013-05-01 22:30:36+00:00)
Title: Correct time_ago_in_words to handle situation where Fixnum#/ returns a Rational

[mathn](https://github.com/ruby/ruby/blob/trunk/lib/mathn.rb) from ruby stdlib aliases `Fixnum#/` to `Fixnum#quo`. If `rational` from stdlib is required (which it is in rails) the result is that `Fixnum/Fixnum` will return a `Rational` number instead of the expected `Fixnum`. This causes `time_ago_in_words` to break:

```
1) Failure:
test_time_ago_in_words(DateHelperTest) [/private/var/www/rails/actionpack/test/template/date_helper_test.rb:166]:
<"about 1 year"> expected but was
<"about 366/365 years">.
```

This PR adds a call to `.to_i` after the division takes place, to ensure the result is a `Fixnum` as expected.