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

Revert .is_a?(JSON::Any) #262

Merged
merged 1 commit into from Jul 23, 2018

Conversation

Blacksmoke16
Copy link
Contributor

Missed this logic when adding JSON::Serializable support.

@@ -122,7 +122,7 @@ module Granite::Fields
when "{{_name.id}}"
if "{{_name.id}}" == "{{PRIMARY[:name]}}"
{% if !PRIMARY[:auto] %}
@{{PRIMARY[:name]}} = value.is_a?(JSON::Any) ? value.raw.as({{PRIMARY[:type]}}) : value.as({{PRIMARY[:type]}})
Copy link
Member

Choose a reason for hiding this comment

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

Can you provide a better explanation? Why do the other types not need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was added in #221 to parse the primary key value from JSON::Any.

Since we are using JSON::Serializable now, we don't define our own .from_json thus JSON::Any never reaches this anymore.

This should have been changed back in #253 with the removal of the rest of the JSON::Any typings, but i missed this one.

Copy link
Member

@drujensen drujensen left a comment

Choose a reason for hiding this comment

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

ugh, my brain is not working this morning. lol. I thought you were adding it back when it said Revert in the title. My diff was reversed.

@drujensen drujensen merged commit 8785735 into amberframework:master Jul 23, 2018
@Blacksmoke16 Blacksmoke16 deleted the revert-JSONAn branch July 23, 2018 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants