mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
Fix serialization_scope to check for private/protected methods
The semantics of respond_to? on Ruby 2.0 have changed to return false for protected methods, which is usually the case for helpers like current_user.
This commit is contained in:
parent
ab5d40f38b
commit
1c1a4f7673
@ -33,7 +33,7 @@ module ActionController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def serialization_scope
|
def serialization_scope
|
||||||
send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope)
|
send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_serializer_options
|
def default_serializer_options
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user