提交 fdbd6779 编写于 作者: V Vasiliy Ermolovich

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

上级 cf0fd053
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册