mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
Improve ActionController::Serialization readability
This commit is contained in:
parent
170db3ba88
commit
47a14b6581
@ -10,6 +10,12 @@ module ActionController
|
|||||||
# Deprecated
|
# Deprecated
|
||||||
ADAPTER_OPTION_KEYS = ActiveModel::SerializableResource::ADAPTER_OPTION_KEYS
|
ADAPTER_OPTION_KEYS = ActiveModel::SerializableResource::ADAPTER_OPTION_KEYS
|
||||||
|
|
||||||
|
module ClassMethods
|
||||||
|
def serialization_scope(scope)
|
||||||
|
self._serialization_scope = scope
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
included do
|
included do
|
||||||
class_attribute :_serialization_scope
|
class_attribute :_serialization_scope
|
||||||
self._serialization_scope = :current_user
|
self._serialization_scope = :current_user
|
||||||
@ -59,11 +65,5 @@ module ActionController
|
|||||||
super(serializable_resource, options)
|
super(serializable_resource, options)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
module ClassMethods
|
|
||||||
def serialization_scope(scope)
|
|
||||||
self._serialization_scope = scope
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user