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