lib/validation.rb in bobes-textmagic-0.3.1 vs lib/validation.rb in bobes-textmagic-0.3.2
- old
+ new
@@ -15,10 +15,10 @@
# 160, 306 and 459 respectively.
# Maximum lengths for 1, 2 and 3-part unicode messages are
# 70, 134 and 201 respectively.</em>
def validate_text_length(text, unicode, parts = 3)
max_text_length = (unicode ? MAX_LENGTH_UNICODE : MAX_LENGTH_GSM)[parts - 1]
- text.size <= max_text_length
+ real_length(text, unicode) <= max_text_length
end
# Validates a list of phone numbers. Returns +true+ if the list is not empty
# and all phone numbers are digit-only strings of maximum length of 15,
# otherwise it returns +false+.