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

Redundant self cop incorrect when arguments mask methods #651

Closed
jonah-williams opened this issue Nov 27, 2013 · 1 comment
Closed

Redundant self cop incorrect when arguments mask methods #651

jonah-williams opened this issue Nov 27, 2013 · 1 comment

Comments

@jonah-williams
Copy link

Given a method of the form:

def set_finalized(finalized = true)
  if self.finalized != finalized
    self.finalized = finalized
    save
  end
end

RedundantSelf identifies a violation and "corrects" the method to be:

def set_finalized(finalized = true)
  if finalized != finalized
    self.finalized = finalized
    save
  end
end

This alters the behavior of the method and introduces incorrect behavior.

@bbatsov
Copy link
Collaborator

bbatsov commented Dec 3, 2013

Thanks for reporting this. I'll have it fixed right away.

@bbatsov bbatsov closed this as completed in 92500e6 Dec 3, 2013
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

2 participants