lib/jsonapi/resource_for.rb in jsonapi-resources-0.0.14 vs lib/jsonapi/resource_for.rb in jsonapi-resources-0.0.15
- old
+ new
@@ -7,10 +7,10 @@
module ClassMethods
# :nocov:
if RUBY_VERSION >= '2.0'
def resource_for(type)
resource_name = JSONAPI::Resource._resource_name_from_type(type)
- Object.const_get resource_name if resource_name
+ Object.const_get(resource_name, false) if resource_name
rescue NameError
raise NameError, "JSONAPI: Could not find resource '#{type}'. (Class #{resource_name} not found)"
end
else
def resource_for(type)