Merge pull request #645 from gauthier-delacroix/Fix-namespaced-serializers-reloading

Fix namespaced serializers reloading
This commit is contained in:
Steve Klabnik 2014-09-09 18:59:31 -04:00
commit 40d6655c24
2 changed files with 7 additions and 7 deletions

View File

@ -4,8 +4,12 @@ module ActiveModel
extend self
def _const_get(const)
method = RUBY_VERSION >= '2.0' ? :const_get : :qualified_const_get
Object.send method, 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

View File

@ -63,11 +63,7 @@ end
ArraySerializer
end
else
begin
_const_get build_serializer_class(resource, options)
rescue NameError
nil
end
_const_get build_serializer_class(resource, options)
end
end