Skip to content

Conversation

viralpraxis
Copy link
Contributor

Resolves #1525

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@viralpraxis viralpraxis force-pushed the change-rails-helper-instance-variable-no-to-detect-ivars-within-classes branch from 42b6e84 to 00fe24d Compare October 10, 2025 13:53
@viralpraxis viralpraxis changed the title [Change Rails/HelperInstanceVariable not to detect offenses for ivars within classes Change Rails/HelperInstanceVariable not to detect offenses for ivars within classes Oct 10, 2025
@viralpraxis viralpraxis force-pushed the change-rails-helper-instance-variable-no-to-detect-ivars-within-classes branch from 00fe24d to 95d9470 Compare October 10, 2025 13:56
end

it 'does not register an offense when a class which inherits `ActionView::Helpers::FormBuilder`' do
it 'does not register an offense when an instance variable is defined within a class' do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add it as a new test instead of updating the existing one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed that one since there's nothing specific about ActionView::Helpers::FormBuilder class anymore. Does it make sense to keep it?

@viralpraxis viralpraxis force-pushed the change-rails-helper-instance-variable-no-to-detect-ivars-within-classes branch from 95d9470 to cfacd2b Compare October 11, 2025 10:14
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.

Allow instance variables inside class definition in helpers

2 participants