# File lib/active_record/validations.rb, line 67 def add_on_boundary_breaking(attributes, range, too_long_msg = @@default_error_messages[:too_long], too_short_msg = @@default_error_messages[:too_short]) for attr in [attributes].flatten value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) : @base[attr.to_s] add(attr, too_short_msg % range.begin) if value && value.length < range.begin add(attr, too_long_msg % range.end) if value && value.length > range.end end end