Repository navigation
Fix mismatched indentation in Ransack::Nodes::Node - #1804
Merged
scarroll32 merged 1 commit intoNov 16, 2026
Merged
scarroll32 merged 1 commit into
scarroll32 merged 1 commit into
Conversation
The private indifferent_params and scalar_param methods sat at column zero, so Ruby warned on load under -w: lib/ransack/nodes/node.rb:55: warning: mismatched indentations at 'end' with 'def' at 50 Indent them to the class body. Whitespace only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
viktorianer
marked this pull request as ready for review
November 16, 2026 11:27
Member
|
LGTM, thank you @viktorianer viktorianer |
3 of 4 tasks
scarroll32
added a commit
that referenced
this pull request
Nov 16, 2026
…1805) * Accept strong parameters in the grouping, condition and sort builders `Search#initialize` unwraps `ActionController::Parameters`, but the nodes built afterwards went through `Node#indifferent_params`, which only took objects responding to `with_indifferent_access`. `build_grouping` and `build_sort` given strong parameters raised `InvalidSearchError`. They are now unwrapped there too. Whether the search counts as permitted is still decided only by the params it was created from. The callers now pass the article, as `scalar_param`'s do, so the message reads "supplied for an attribute" rather than "a attribute". Also drops the blank line left before the end of the class. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Enable Layout/DefEndAlignment RuboCop runs with every cop disabled by default and none of the enabled ones checked that `end` lines up with its `def`, which is how the misindented methods in Ransack::Nodes::Node got through. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * Remove the ransack/invalid_search_error shim The error classes live in ransack/errors, which `require 'ransack'` loads. Code that requires `ransack/invalid_search_error` directly needs to require `ransack` or `ransack/errors` instead. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
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.
Consider supporting us via Open Collective
What this changes
Loading Ransack 6.1.0 (and
main) with warnings enabled prints:The private
indifferent_paramsandscalar_parammethods added in #1763 lost their indentation: their bodies, their closingends and the comment abovescalar_paramsit at column zero insideRansack::Nodes::Node. This indents them to the class body. The change is whitespace only:git diff -wis empty.Verified on Ruby 4.0.7:
bundle exec ruby -w -Ilib -e 'require "ransack"'prints the warning above before the change and nothing after it.ruby -wc lib/ransack/nodes/node.rbwarns before and prints onlySyntax OKafter.bundle exec rake spec(SQLite): 1169 examples, 0 failures.bundle exec rubocop: no offenses.Checklist
bundle exec rake specpassesdocs/are updated for any user-visible change (none needed)See the Contributing Guide.
🤖 Generated with Claude Code