Files
grecia/app/components/sdg/goals/help_page_component.rb
taitus b9bffeb321 Add and apply Naming/PredicateMethod RuboCop 1.76 rule
This rule was introduced in RuboCop 1.76.0 to ensure methods ending
in '?' return boolean.

This commit applies suggested renames and code cleanup:
- Renames 'is_active?' to 'active_class' since it returns a string
- Renames 'parsed_value' to 'in_favor?' and 'is_request_active' to end with '?'
  for boolean semantics
- Skips false positives like 'save', 'auto_labels' or 'save_requiring_finish_signup',
  which are not predicate methods.
2025-06-16 16:07:35 +02:00

18 lines
258 B
Ruby

class SDG::Goals::HelpPageComponent < ApplicationComponent
attr_reader :goals
def initialize(goals)
@goals = goals
end
def render?
feature?("sdg")
end
private
def active_class(goal)
"is-active" if goal.code == 1
end
end