method

tokenize

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveModel::Validations::LengthValidator

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.0.0.1) is shown here.

These similar methods exist in v7.1.3.2:

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.