Made necessary changes to allow use with Rails 7.0+#27
Open
lukebooth wants to merge 1 commit intoboblail:masterfrom
Open
Made necessary changes to allow use with Rails 7.0+#27lukebooth wants to merge 1 commit intoboblail:masterfrom
lukebooth wants to merge 1 commit intoboblail:masterfrom
Conversation
kobsy
approved these changes
Aug 21, 2025
Contributor
kobsy
left a comment
There was a problem hiding this comment.
LGTM 👍 Thanks for digging into this, @lukebooth
boblail
approved these changes
Aug 22, 2025
lib/pluck_map/presenter.rb
Outdated
| result = nil | ||
| ms = Benchmark.ms { result = yield } | ||
| PluckMap.logger.info "\e[33m#{title}: \e[1m%.1fms\e[0m" % ms | ||
| benchmark_klass = ActiveRecord.version.to_s.split(".").first.to_i > 7 ? ActiveSupport::Benchmark : Benchmark |
Owner
There was a problem hiding this comment.
Isn't Benchmark in the standard library? What prevents from just using ::Benchmark all the time?
Author
There was a problem hiding this comment.
You're not wrong 😅
I tried that first and was still getting an error running the appraisal for Rails 8. I guess Rails doesn't require it for us anymore at that point. Adding a require "benchmark" fixed it. But I did keep the realtime change because ms will be removed in 8.1.
This does remove the appraisals for <6. I don’t know that we _have_ to make that call, but if we’re going to make a new 2.0.x version for these changes, I think it’d be ok to say you need this version if you’re on Rails 6+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This does remove the appraisals for
<6. I don’t know that we have to make that call, but if we’re going to make a new2.0.xversion for these changes, I think it’d be ok to say you need this version if you’re on Rails6+