Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't call an extra method if options[:tokenizer] is not present

  • Loading branch information...
commit fdbd6779fe1a9d54c55b401f4b2a92b5e5ef1e8f 1 parent cf0fd05
@nashby nashby authored
Showing with 2 additions and 4 deletions.
  1. +2 −4 activemodel/lib/active_model/validations/length.rb
View
6 activemodel/lib/active_model/validations/length.rb
@@ -56,10 +56,8 @@ def validate_each(record, attribute, value)
private
def tokenize(value)
- if value.kind_of?(String)
- if options[:tokenizer]
- options[:tokenizer].call(value)
- end
+ if options[:tokenizer] && value.kind_of?(String)
+ options[:tokenizer].call(value)
end || value
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.