mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 06:46:50 +00:00
Merge pull request #645 from gauthier-delacroix/Fix-namespaced-serializers-reloading
Fix namespaced serializers reloading
This commit is contained in:
commit
40d6655c24
@ -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