-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Define a class method to introspect valid delegatable types so they can #50662
Define a class method to introspect valid delegatable types so they can #50662
Conversation
be used to validate the type column and power strong parameters.
@@ -3007,6 +3007,7 @@ With this definition complete, our `Entry` delegator now provides the following | |||
|
|||
| Method | Return | | |||
|---|---| | |||
| `Entry#entryable_types` | ["Message", "Comment"] | |
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 this be Entry.entryable_types
?
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.
Yes indeed.
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.
#50819 @tanaken0515 fixed this already - thanks!
Correct typo in activerecord changelog for -rails#50662
Correct typo in activerecord changelog for -rails#50662
Correct typo in activerecord changelog for -#50662
Correct typo in activerecord changelog for -rails#50662
Motivation / Background
While dealing with strong parameters in API requests and validating the polymorphic type field for a delegated type in a slightly abstract manner, its useful to have access to the allowed types.
Detail
This Pull Request changes the methods defined by ActiveRecord::DelegatedType
Additional information
N/A
Checklist
Before submitting the PR make sure the following are checked:
[Fix #issue-number]