Sha256: 415172abf2cc69749cb1ac85dab1fac1d4e38e0268a4e3f0d08e211b5ebd35c3

Contents?: true

Size: 368 Bytes

Versions: 1

Compression:

Stored size: 368 Bytes

Contents

module ActiveRecord
  module MySQL
    module Strict
      class Validation
        class StringValidation < Validation
          LIMIT = 255

          def apply
            model.validates field.name, 'ActiveRecord::MySQL::Strict::Validator::StrictLength' => { in: 0..(field.limit || LIMIT) }, allow_blank: true
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord_mysql_strict-0.2.1 lib/active_record/mysql/strict/validation/string_validation.rb