Skip to content

Support conditional setting of serialization_scope in controllers #1711

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

Conversation

yogeshjain999
Copy link
Contributor

Purpose

I want to set serialization_scope as different object rather than current_user, for only specific actions in given controller.

Changes

Adds support for setting serialization_scope conditionally in controllers, same as calling before_action with options.

@yogeshjain999 yogeshjain999 force-pushed the conditional_serialization_scope branch from e89c5e6 to 036d68d Compare May 1, 2016 07:24
@bf4
Copy link
Member

bf4 commented May 2, 2016

I like it. I need to look at the test changes a bit.

@@ -71,10 +77,12 @@ class DefaultScopeTest < ActionController::TestCase
tests PostTestController

def test_default_serialization_scope
get :render_post
Copy link
Member

@bf4 bf4 May 31, 2016

Choose a reason for hiding this comment

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

this is supposed to be missing in this test :)

@bf4
Copy link
Member

bf4 commented Jun 6, 2016

Closing as stale. No response in a month.

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