lib/kanzen/inspection.rb in kanzen-0.2.0 vs lib/kanzen/inspection.rb in kanzen-0.3.0
- old
+ new
@@ -66,24 +66,14 @@
add_to_missing_attributes(another_model, attribute)
end
def is_attribute_valid?(another_model, attribute)
- # Check if a custom verification (proc) was passed to verify if the
- # attribute is valid.
- #
# The proc must return TRUE if a given attribute
# is VALID and FLASE if it IS INVALID
- if proc
- attribute_value = another_model.send(attribute)
+ attribute_value = another_model.send(attribute)
- return proc.call(attribute_value)
- end
-
- # If a proc wasn't passed, just check if the attribute is nil
- # If the attribute is NIL, it means that it is INVALID
- # If the attribute is NOT NIL, it means that it is VALID
- !another_model.send(attribute).nil?
+ proc.call(attribute_value)
end
# Check attributes
# Check has_one associations
# Check has_many associations
\ No newline at end of file