mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Fix namespaced serializers reloading
This commit is contained in:
parent
605408005f
commit
e273fc5854
@ -4,8 +4,12 @@ module ActiveModel
|
|||||||
extend self
|
extend self
|
||||||
|
|
||||||
def _const_get(const)
|
def _const_get(const)
|
||||||
method = RUBY_VERSION >= '2.0' ? :const_get : :qualified_const_get
|
begin
|
||||||
Object.send method, const
|
method = RUBY_VERSION >= '2.0' ? :const_get : :qualified_const_get
|
||||||
|
Object.send method, const
|
||||||
|
rescue NameError
|
||||||
|
const.safe_constantize
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -63,11 +63,7 @@ end
|
|||||||
ArraySerializer
|
ArraySerializer
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
_const_get build_serializer_class(resource, options)
|
||||||
_const_get build_serializer_class(resource, options)
|
|
||||||
rescue NameError
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user