lib/jsonapi/resource_for.rb in jsonapi-resources-0.0.4 vs lib/jsonapi/resource_for.rb in jsonapi-resources-0.0.5
- old
+ new
@@ -5,15 +5,13 @@
end
module ClassMethods
if RUBY_VERSION >= '2.0'
def resource_for(type)
- begin
- resource_name = JSONAPI::Resource._resource_name_from_type(type)
- Object.const_get resource_name if resource_name
- rescue NameError
- nil
- end
+ resource_name = JSONAPI::Resource._resource_name_from_type(type)
+ Object.const_get resource_name if resource_name
+ rescue NameError
+ nil
end
else
def resource_for(type)
resource_name = JSONAPI::Resource._resource_name_from_type(type)
resource_name.safe_constantize if resource_name
\ No newline at end of file