lib/aequitas/violation_set.rb in aequitas-0.0.1 vs lib/aequitas/violation_set.rb in aequitas-0.0.2

- old
+ new

@@ -77,19 +77,18 @@ # Return validation violations for a particular attribute_name. # # @param [Symbol] attribute_name # The name of the field you want an violation for. # - # @return [Array(Violation, String), NilClass] + # @return [Array(Violation, String)] # Array of Violations, if there are violations on +attribute_name+ # nil if there are no violations on +attribute_name+ # # @api public # # TODO: use a data structure that ensures uniqueness def on(attribute_name) - attribute_violations = violations[attribute_name] - attribute_violations.empty? ? nil : attribute_violations.uniq + violations[attribute_name].uniq end # @api public def each violations.each_value do |v|