lib/graphiti/util/attribute_check.rb in graphiti-1.0.alpha.8 vs lib/graphiti/util/attribute_check.rb in graphiti-1.0.alpha.9
- old
+ new
@@ -54,30 +54,19 @@
request? &&
attribute[flag].is_a?(Symbol) &&
attribute[flag] != :required
end
- def cache?
- !!@cache
- end
-
def error_class
Errors::AttributeError
end
def supported?
attribute[flag] != false
end
- # If running in a request context, we've already loaded everything
- # and there's no reason to perform logic, so go through attriubte cache
- # Otherwise, this is a performance hit during typecasting
def attribute
- @attribute ||= if request?
- resource.class.attribute_cache[name]
- else
- resource.all_attributes[name]
- end
+ @attribute ||= resource.all_attributes[name]
end
def attribute?
!!attribute
end