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:
commit
b28ed2bd4f
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue