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

Rails/UniqBeforePluck exception #1427

Open
PuntoDiGoccia opened this issue Jan 24, 2025 · 0 comments
Open

Rails/UniqBeforePluck exception #1427

PuntoDiGoccia opened this issue Jan 24, 2025 · 0 comments

Comments

@PuntoDiGoccia
Copy link

This code

    Global::ReservedSubdomain.upsert_all(
      Global::Customer
      .pluck(:subdomain)
      .uniq
      .map{|s| {value: s}}
    )

causes exception

1 error occurred:
An error occurred while Rails/UniqBeforePluck cop was inspecting /usr/src/app/db/migrate/20250124101501_init_reserved_subdomains.rb:6:6.
configuration from /usr/src/app/.rubocop.yml
Errors are usually caused by RuboCop bugs.
Please, update to the latest RuboCop version if not already in use, and report a bug if the issue still occurs on this version.
https://github.com/rubocop/rubocop/issues

Mention the following information in the issue report:
1.71.0 (using Parser 3.3.7.0, rubocop-ast 1.37.0, analyzing as Ruby 2.7, running on ruby 3.3.7) [aarch64-linux]

with -d option

Scanning /usr/src/app/db/migrate/20250124101501_init_reserved_subdomains.rb
An error occurred while Rails/UniqBeforePluck cop was inspecting /usr/src/app/db/migrate/20250124101501_init_reserved_subdomains.rb:6:6.
Parser::Source::TreeRewriter detected clobbering
/usr/local/bundle/gems/parser-3.3.7.0/lib/parser/source/tree_rewriter.rb:427:in `trigger_policy'
/usr/local/bundle/gems/parser-3.3.7.0/lib/parser/source/tree_rewriter.rb:414:in `enforce_policy'
/usr/local/bundle/gems/parser-3.3.7.0/lib/parser/source/tree_rewriter/action.rb:234:in `call'
/usr/local/bundle/gems/parser-3.3.7.0/lib/parser/source/tree_rewriter/action.rb:234:in `swallow'
...

RuboCop version

1.71.0 (using Parser 3.3.7.0, rubocop-ast 1.37.0, analyzing as Ruby 3.3, running on ruby 3.3.7) [aarch64-linux]
  - rubocop-factory_bot 2.26.1
  - rubocop-performance 1.23.1
  - rubocop-rails 2.29.0
  - rubocop-rake 0.6.0
  - rubocop-rspec 3.4.0
  - rubocop-rspec_rails 2.30.0
  - rubocop-thread_safety 0.6.0
@koic koic transferred this issue from rubocop/rubocop Jan 24, 2025
Earlopain added a commit to Earlopain/rubocop-rails that referenced this issue Jan 24, 2025
…with multi-line expression

This introduces a bit of whitespace when the expression spans multiple lines, but that seesm fine
Earlopain added a commit to Earlopain/rubocop-rails that referenced this issue Jan 24, 2025
…i-line expression

This introduces a bit of whitespace when the expression spans multiple lines, but that seesm fine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant