Sha256: 0742a92e87a5937182aaa04812ac7dc174033e12e452480e86972678e4cf1eb3
Contents?: true
Size: 446 Bytes
Versions: 40
Compression:
Stored size: 446 Bytes
Contents
module ActiveRecordSurvey # Ensure the instance_node has a length less than the maximum class NodeValidation::MaximumLength < NodeValidation # Validate the instance_node value def validate_instance_node(instance_node, answer_node = nil) is_valid = (self.value.to_i >= instance_node.value.to_s.length.to_i) instance_node.errors[:base] << { :nodes => { answer_node.id => ["MAXIMUM_LENGTH"] } } if !is_valid is_valid end end end
Version data entries
40 entries across 40 versions & 1 rubygems