1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #4172 from nashby/refactor-tokenizer

don't call an extra method if options[:tokenizer] is not present
This commit is contained in:
José Valim 2011-12-24 12:48:45 -08:00
commit b28ed2bd4f

View file

@ -56,10 +56,8 @@ module ActiveModel
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