mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Nest scope under context option
This commit is contained in:
committed by
Santiago Pastorino
parent
8bd2542ed2
commit
0d8ef2b165
@@ -43,7 +43,7 @@ module ActionController
|
||||
class DefaultOptionsForSerializerScopeTest < ActionController::TestCase
|
||||
class MyController < ActionController::Base
|
||||
def default_serializer_options
|
||||
{ scope: current_admin }
|
||||
{ context: { scope: current_admin } }
|
||||
end
|
||||
|
||||
def render_using_scope_set_in_default_serializer_options
|
||||
@@ -73,7 +73,7 @@ module ActionController
|
||||
class ExplicitSerializerScopeTest < ActionController::TestCase
|
||||
class MyController < ActionController::Base
|
||||
def render_using_implicit_serializer_and_explicit_scope
|
||||
render json: Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }), scope: current_admin
|
||||
render json: Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' }), context: { scope: current_admin }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user