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

Naming/MemoizedInstanceVariableName #90

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Apr 20, 2023

This PR renames a few internal instance variables to be consistent with their memoizer methods. No one should be accessing these directly.

  • lib/mongoid/document.rb - rename @_type to @_types
  • lib/mongoid/document.rb - rename @model_cache_key to @model_key
  • lib/mongoid/association/relatable.rb - rename @class_name to @relation_class_name
  • lib/mongoid/association/relatable.rb - rename @klass to @relation_class
  • lib/mongoid/contextual/mongo.rb - make documents_loader a private memoizer method (was an attr_accessor). Can call load_sync publicly to get the loader. this functionality is @api private so no one should be using it.
  • lib/mongoid/traversable.rb - Skip @__parent, @__children, and @__descendants as per code comment.

@johnnyshields johnnyshields marked this pull request as draft April 20, 2023 18:22
@johnnyshields johnnyshields changed the title Naming cop fixes Naming/MemoizedInstanceVariableName Apr 20, 2023
@johnnyshields johnnyshields marked this pull request as ready for review August 27, 2023 18:45
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