mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
commit
a65e86bb52
@ -33,13 +33,15 @@ module ActionController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def serialization_scope
|
def serialization_scope
|
||||||
send(_serialization_scope) if _serialization_scope && respond_to?(_serialization_scope, true)
|
send(_serialization_scope) if _serialization_scope &&
|
||||||
|
respond_to?(_serialization_scope, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
def default_serializer_options
|
def default_serializer_options
|
||||||
end
|
end
|
||||||
|
|
||||||
def _render_option_json(resource, options)
|
[:_render_option_json, :_render_with_renderer_json].each do |renderer_method|
|
||||||
|
define_method renderer_method do |resource, options|
|
||||||
json = ActiveModel::Serializer.build_json(self, resource, options)
|
json = ActiveModel::Serializer.build_json(self, resource, options)
|
||||||
|
|
||||||
if json
|
if json
|
||||||
@ -48,6 +50,7 @@ module ActionController
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def serialization_scope(scope)
|
def serialization_scope(scope)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user