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

MONGOID-5563 Code Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association #5547

Merged

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Feb 16, 2023

This PR is code-doc changes only, it does not change any logic

Mongoid::Association is poorly named. It is actually a mixin included in the Mongoid::Document class, which makes a document capable of being associated. (Mongoid::Associable would be a far better name, as the general practice is for mixins to end in -able suffix.)

The association metadata classes like HasOne, EmbedsMany, etc. do not inherit from Mongoid::Association. Instead, these include Mongoid::Association::Relatable mixin as their common base.

Therefore, where docs currently reference type Association (i.e. metadata) it is incorrect, we should replace it with Mongoid::Association::Relatable.

@johnnyshields johnnyshields changed the title Docs: Use Mongoid::Association::Relatable instead of Mongoid::Association Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association Feb 16, 2023
@johnnyshields johnnyshields changed the title Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association MONGOID-5563 Code Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association Feb 16, 2023
@johnnyshields johnnyshields changed the title MONGOID-5563 Code Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association [READY FOR REVIEW] MONGOID-5563 Code Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association Feb 16, 2023
Copy link
Contributor

@jamis jamis left a comment

Choose a reason for hiding this comment

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

Good clarification!

@jamis jamis changed the title [READY FOR REVIEW] MONGOID-5563 Code Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association MONGOID-5563 Code Docs: Correctly use Mongoid::Association::Relatable instead of Mongoid::Association Feb 28, 2023
@jamis jamis merged commit a5e5cd6 into mongodb:master Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants