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

Fix read_attribute_for_serialization not seeing parent serializer methods #1661

Merged

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Apr 4, 2016

Fixes #1653, #1658, #1660

Was introduced in #1650

@@ -189,7 +176,7 @@ def json_key
end

def read_attribute_for_serialization(attr)
if self.class._serializer_instance_method_defined?(attr)
if respond_to?(attr)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is waayyy simpler. interesting. Why was it so complicated before?

@NullVoxPopuli
Copy link
Contributor

Thanks, I'll give this a go on my repo, and see how it fairs.

@NullVoxPopuli
Copy link
Contributor

I can confirm that this works

@bf4
Copy link
Member Author

bf4 commented Apr 4, 2016

@NullVoxPopuli

Thanks, I'll give this a go on my repo, and see how it fairs.

s/fairs/fares which I think makes be a sociopath for pointing out per http://www.npr.org/2016/04/02/472716926/panel-round-one

PETER SAGAL, HOST:

Right now, panel, it is time for you to answer some questions about this week's news. Amy, a new study from the University of Michigan finds that one sign a person might be a sociopath is if they call constantly do what.

SAGAL: People who correct typos and grammar. People are always begging the question - does pointing other people's errors make you a helpful person or an ass? And before you write in to tell me, I just misused the phrase begging the question, and I know you want to.

SAGAL: According to science, the urge to correct errors like that means you're a jerk. The researchers took a group of 83 people and they gave them all personality tests to sort them into what kind of person they are. And then they asked them to read and rate various essays and talk about the content. Some of the essays had typos and grammatical errors, some didn't. And what they found is that the people who were open and kind and generally forgiving just talked about what was written in the essays. They never noticed the typos. It was the asocial, introverted, crabby, unpleasant people that said, well, I can't read this. There's an apostrophe in the, your, when there shouldn't be.

@NullVoxPopuli
Copy link
Contributor

ah, yep: http://grammarist.com/usage/fair-fare/ :-)

@NullVoxPopuli
Copy link
Contributor

does pointing other people's errors make you a helpful person or an ass?

I think it's helpful, depending on the tone. Cause it helps reduce my liklihood of being an idiot in the future

…hods

Fixes rails-api#1653, rails-api#1658, rails-api#1660

Define "scope_name" on instance singleton, not all instances
@bf4 bf4 force-pushed the fix_read_attribute_for_inherited_methods branch from c6bcaab to 6370e5c Compare April 4, 2016 17:29
@bf4
Copy link
Member Author

bf4 commented Apr 4, 2016

Added changelog, rebased off of master, and squashed

@NullVoxPopuli
Copy link
Contributor

cool, I'll merge once CI passes

@NullVoxPopuli NullVoxPopuli merged commit 5070377 into rails-api:master Apr 4, 2016
@NullVoxPopuli NullVoxPopuli deleted the fix_read_attribute_for_inherited_methods branch April 4, 2016 18:14
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.

2 participants