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

Methods defined in serializer are not used #1660

Closed
NullVoxPopuli opened this issue Apr 4, 2016 · 6 comments
Closed

Methods defined in serializer are not used #1660

NullVoxPopuli opened this issue Apr 4, 2016 · 6 comments

Comments

@NullVoxPopuli
Copy link
Contributor

Expected behavior vs actual behavior

Possibly related to #1658.

I expect the methods defined in the serializer to be used for the attributes.

What is happening is the attribute is invoked on the object, resulting in an error if the method does not exist.

Steps to reproduce

(e.g., detailed walkthrough, runnable script, example application)

Environment

ActiveModelSerializers Version (commit ref if not on tag):

Output of ruby -e "puts RUBY_DESCRIPTION":

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

OS Type & Version: Ubuntu 15.10 64bit

Integrated application and version (e.g., Rails, Grape, etc):

rails: 4.2.6
AMS: RC4 works
AMS: master has this issue

Backtrace

(e.g., provide any applicable backtraces from your application)

image

Additonal helpful information

(e.g., Gemfile.lock, configurations, PR containing a failing test, git bisect results)

https://github.com/NullVoxPopuli/aeonvera/blob/master/Gemfile.lock

I tried working on a failing test with the AMS code, but something funky is happening, I'll continue to investigate.

@NullVoxPopuli
Copy link
Contributor Author

This commit works: 5be33af

@NullVoxPopuli
Copy link
Contributor Author

which is weird, because no code changes have occurred after that commit -- just documentation changes.

@groyoh
Copy link
Member

groyoh commented Apr 4, 2016

@NullVoxPopuli maybe related to #1650

@NullVoxPopuli
Copy link
Contributor Author

@groyoh see these comments: #1658 (comment)

@bf4
Copy link
Member

bf4 commented Apr 4, 2016

Related to #1653 I believe I introduced this

bf4 added a commit to bf4/active_model_serializers that referenced this issue Apr 4, 2016
bf4 added a commit to bf4/active_model_serializers that referenced this issue Apr 4, 2016
…hods

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

Define "scope_name" on instance singleton, not all instances
@NullVoxPopuli
Copy link
Contributor Author

Fixed by #1661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants