Skip to content

style(rubocop): resolve Naming/PredicatePrefix todo entry - #2773

Merged
mroderick merged 1 commit into
masterfrom
fix/rubocop-predicate-prefix
Jul 31, 2026
Merged

style(rubocop): resolve Naming/PredicatePrefix todo entry#2773
mroderick merged 1 commit into
masterfrom
fix/rubocop-predicate-prefix

Conversation

@mroderick

@mroderick mroderick commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Problem

The Naming/PredicatePrefix todo entry excluded six files so that predicate methods could keep their is_/has_ prefixes.

Solution

Rename the offenders and remove the exclusions. Purely mechanical, no behaviour changes:

  • is_logged_in?require_login and has_access?require_access in ApplicationController (these redirect rather than return a boolean, so the predicate prefix was misleading anyway)
  • Workshop#has_host?host?, Workshop#has_valid_host?valid_host?
  • Policy predicates drop their is_ prefix, e.g. is_admin_or_organiser?admin_or_organiser?, is_chapter_organiser?chapter_organiser?

user.is_admin? calls are untouched: that method is generated dynamically by Rolify, so there is no definition for the cop to flag.

Split out from #2768; independent of the other RuboCop PRs.

@mroderick
mroderick marked this pull request as ready for review July 31, 2026 19:07
@mroderick
mroderick merged commit bbeb34c into master Jul 31, 2026
10 checks passed
@mroderick
mroderick deleted the fix/rubocop-predicate-prefix branch July 31, 2026 19:08
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

Successfully merging this pull request may close these issues.

1 participant