Fix namespaced serializers reloading

This commit is contained in:
Gauthier Delacroix 2014-09-08 13:59:50 +02:00
parent 605408005f
commit e273fc5854
2 changed files with 7 additions and 7 deletions

View File

@ -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

View File

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