From 52d8f8139531b632c7f7e2582457f407a44c190c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xurxo=20Me=CC=81ndez=20Pe=CC=81rez?= Date: Mon, 22 Sep 2014 11:32:00 +0200 Subject: [PATCH] Makes it possible to use current user within serializers --- lib/grape-active_model_serializers/formatter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/grape-active_model_serializers/formatter.rb b/lib/grape-active_model_serializers/formatter.rb index 50fba60..87f2b11 100644 --- a/lib/grape-active_model_serializers/formatter.rb +++ b/lib/grape-active_model_serializers/formatter.rb @@ -17,7 +17,7 @@ def fetch_serializer(resource, env) options = build_options_from_endpoint(endpoint) if serializer = options.fetch(:serializer, ActiveModel::Serializer.serializer_for(resource)) - options[:scope] = endpoint.serialization_scope unless options.has_key?(:scope) + options[:scope] = endpoint unless options.has_key?(:scope) # ensure we have an root to fallback on options[:resource_name] = default_root(endpoint) if resource.respond_to?(:to_ary) serializer.new(resource, options.merge(other_options))