Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveSupport::Duration#inspect returns invalid output when integer division #42802

Open
ysugiyama12 opened this issue Jul 16, 2021 · 1 comment

Comments

@ysugiyama12
Copy link

Steps to reproduce

require "active_support/all"

(1.second + 1.hour/10).inspect
# (1.second + 1.hour/10.0).inspect works properly due to float division

Expected behavior

0.1 hour, 1 second or 361 seconds

Actual behavior

1 second

System configuration

Rails version:
6.1.3.2

Ruby version:
2.7.3

@ysugiyama12 ysugiyama12 changed the title Rails 6.1.3.2: ActiveSupport::Duration#inspect returns invalid output when integer division ActiveSupport::Duration#inspect returns invalid output when integer division Jul 16, 2021
@martinjaimem
Copy link
Contributor

I'd like to investigate this one if possible 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@p8 @ysugiyama12 @martinjaimem and others