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

scope is 'nil' in Serializer #102

Open
chadwtaylor opened this issue May 21, 2014 · 3 comments
Open

scope is 'nil' in Serializer #102

chadwtaylor opened this issue May 21, 2014 · 3 comments
Milestone

Comments

@chadwtaylor
Copy link

According to ActiveModelSerializer, we should be able to access the scope object, which is the 'current_user' by default. I'm getting 'nil' when I try to access the scope object. I already have the current_user method defined in my controller.

Any tips or advice on how to properly access or enable scope objects would be greatly appreciated.

@ahegyi
Copy link
Contributor

ahegyi commented Jul 11, 2014

Be sure you're setting a serialization_scope in your controller; check the docs: https://github.com/rails-api/active_model_serializers/tree/0-8-stable#customizing-scope

Shouldn't have anything to do with Rocket Pants.

@Sutto
Copy link
Owner

Sutto commented May 20, 2015

We don't pass this through, but ideally should now that we're thinking about it -The simpler solution is to override the default objects, but that requires a bit more work. I know how late this response is, but assigning it to v1.13 to take a look

@Sutto Sutto added this to the v1.13 milestone May 20, 2015
@rsobers
Copy link

rsobers commented Oct 26, 2015

+1

Anyone have a workaround for now?

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

No branches or pull requests

4 participants