Skip to content

Commit

Permalink
Merge pull request #24 from sonxurxo/master
Browse files Browse the repository at this point in the history
Makes it possible to use current_user within serializers
  • Loading branch information
jrhe committed Oct 6, 2014
2 parents a2c8632 + 52d8f81 commit 85b92a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/grape-active_model_serializers/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 85b92a4

Please sign in to comment.