-
Notifications
You must be signed in to change notification settings - Fork 6
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
Benefits of using polymorphic association in ruby on rails #185
base: main
Are you sure you want to change the base?
Conversation
|
||
## Illustrating Polymorphic Association with AWS Synchronization | ||
|
||
Let's integrate a real-world example of polymorphic association for tracking AWS synchronization for two distinct models: `Patient` and `Doctor`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can say, "Let's look at/explore a real world example"
## 5. Easy Attachability | ||
|
||
Enabling functionality for multiple models becomes a seamless process with polymorphic association. | ||
In our example, where functionality is enabled for three models, additional models can adopt the same functionality without requiring any database changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we present the example before this?
|
||
The ease of attaching functionality to different models not only simplifies the development process but also helps in avoiding code duplication. | ||
|
||
As mentioned in point number 5, incorporating a module for a specific functionality ensures that the same codebase can be reused across various models, promoting cleaner and more maintainable code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can link the point no. 5 heading hete
|
||
In this blog post, we'll explore the advantages of leveraging polymorphic association in Ruby on Rails. | ||
|
||
## 1. Storage Saving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Efficient Storage Use?
By separating functionality into dedicated tables, developers can create indexes tailored to specific needs without impacting the performance of the main table. | ||
This approach contributes to a more efficient and responsive application. | ||
|
||
## 5. Easy Attachability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should explain attachability in this context as it is not that commonly used
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made formatting fixes, left some suggestions
LGTM otherwise
What did you do?
Please include a summary of the changes.
Why did you do it?
Why were these changes made?
Screenshots (Please include if anything visual)
Include any relevant screenshots that may help explain the change.