Repository navigation
Fix enum losing attribute type cast. - #39902
Merged
kamipo merged 1 commit intoJul 22, 2020
Merged
Conversation
Contributor
Author
|
@kamipo Can you review this for me? |
tgxworld
commented
Jul 22, 2020
Comment on lines
+185
to
+190
| type, options = attributes_to_define_after_schema_loads[attr] | ||
|
|
||
| attribute(attr, **default) do |subtype| | ||
| if type && !type.is_a?(Proc) | ||
| subtype = _lookup_cast_type(attr, type, options) | ||
| end |
Contributor
Author
There was a problem hiding this comment.
This is similar to
Contributor
Author
|
Thank you for the review @kamipo 👍 |
kamipo
added a commit
that referenced
this pull request
Jul 27, 2020
Originally #39882 is intended to remove `decorate_matching_attribute_type` but leave `decorate_attribute_type` at that point, but in the disscussion in #39882, to demonstrate removing `AttributeDecorators` module, I've removed all decoration methods. I wrote user-defined type decoration as inline, I wasn't sure that is valid (meaningful) usage (that is a reason why I wasn't in a hurry to remove that method), as I said at #39882 (comment). In #39897 and #39902, `enum` also need to support user-defined type decoration, so I've decided to add back `decorate_attribute_type` as before #39882.
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.
Resolves #39897