Benefits of using polymorphic association in ruby on rails#185
Open
hulksyed07 wants to merge 3 commits intomainfrom
Open
Benefits of using polymorphic association in ruby on rails#185hulksyed07 wants to merge 3 commits intomainfrom
hulksyed07 wants to merge 3 commits intomainfrom
Conversation
2KAbhishek
reviewed
Nov 13, 2023
|
|
||
| ## 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`. |
Collaborator
There was a problem hiding this comment.
Maybe we can say, "Let's look at/explore a real world example"
2KAbhishek
reviewed
Nov 13, 2023
| ## 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. |
Collaborator
There was a problem hiding this comment.
Should we present the example before this?
2KAbhishek
reviewed
Nov 13, 2023
|
|
||
| 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. |
Collaborator
There was a problem hiding this comment.
You can link the point no. 5 heading hete
2KAbhishek
reviewed
Nov 13, 2023
|
|
||
| In this blog post, we'll explore the advantages of leveraging polymorphic association in Ruby on Rails. | ||
|
|
||
| ## 1. Storage Saving |
Collaborator
There was a problem hiding this comment.
Efficient Storage Use?
2KAbhishek
reviewed
Nov 13, 2023
| 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 |
Collaborator
There was a problem hiding this comment.
We should explain attachability in this context as it is not that commonly used
2KAbhishek
approved these changes
Nov 13, 2023
Collaborator
2KAbhishek
left a comment
There was a problem hiding this comment.
Made formatting fixes, left some suggestions
LGTM otherwise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.