Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Mutate Constant.foo to self.class.foo #77

Open
backus opened this issue Apr 23, 2017 · 0 comments
Open

Mutate Constant.foo to self.class.foo #77

backus opened this issue Apr 23, 2017 · 0 comments

Comments

@backus
Copy link
Collaborator

backus commented Apr 23, 2017

Useful for code like

class User
  def blah
    User.recent.first(5)
  end
end

in this case the instance method #blah doesn't need to repeat its class name and could instead specify self.class.recent.first(5)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant