method

tokenize

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveModel::Validations::LengthValidator
tokenize(record, value) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/validations/length.rb, line 83
      def tokenize(record, value)
        tokenizer = options[:tokenizer]
        if tokenizer && value.kind_of?(String)
          if tokenizer.kind_of?(Proc)
            tokenizer.call(value)
          elsif record.respond_to?(tokenizer)
            record.send(tokenizer, value)
          end
        end || value
      end
Register or log in to add new notes.