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

Already on GitHub? Sign in to your account

Range#min, Range#max issue #1086

piotrdebosz opened this Issue May 16, 2011 · 2 comments


None yet
2 participants

According to that issue: https://rails.lighthouseapp.com/projects/8994/tickets/6779-activesupporttimewithzone-in-range-performance-bug

In Ruby 1.8.7 methods Range#min, Range#max are included from Enumerable. These methods iterate all range, so finding min or max takes a lot of time. In Ruby 1.9.2 it's been fixed by adding own Range#min, Range#max methods.

I've created patch, which is adding own Range#min, Range#max methods only when these methods are included from other module, so it's working with both Ruby versions.

My patch: https://github.com/piotrdebosz/rails/commit/a7cb0d5f03e75d1d73f88b50744f947e50fd6649

Could you provide some feedback ?


gmile commented May 18, 2011

Why not pull requesting the patch?

Thanks gmile.

I thought pull requests are not viewed in issues, so my mistake.

I've created pull request with this commit so I'm closing this issue.

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