Sha256: c123f478a7ee7ded9117478f969b05b8d793f406a6de201d2a6e9ad6150af3d8

Contents?: true

Size: 463 Bytes

Versions: 35

Compression:

Stored size: 463 Bytes

Contents

module Schematic
  module Generator
    module Restrictions
      class Length < Base
        def generate(builder)
          for_validator ActiveModel::Validations::LengthValidator do |validator|
            builder.xs(:maxLength, "value" => validator.options[:maximum]) if validator.options[:maximum]
            builder.xs(:minLength, "value" => validator.options[:minimum]) if validator.options[:minimum]
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
schematic-0.6.2 lib/schematic/generator/restrictions/length.rb
schematic-0.6.1 lib/schematic/generator/restrictions/length.rb
schematic-0.6.0 lib/schematic/generator/restrictions/length.rb
schematic-0.5.9 lib/schematic/generator/restrictions/length.rb
schematic-0.5.8 lib/schematic/generator/restrictions/length.rb
schematic-0.5.7 lib/schematic/generator/restrictions/length.rb
schematic-0.5.6 lib/schematic/generator/restrictions/length.rb
schematic-0.5.5 lib/schematic/generator/restrictions/length.rb
schematic-0.5.4 lib/schematic/generator/restrictions/length.rb
schematic-0.5.3 lib/schematic/generator/restrictions/length.rb
schematic-0.5.2 lib/schematic/generator/restrictions/length.rb
schematic-0.5.1 lib/schematic/generator/restrictions/length.rb
schematic-0.5.0 lib/schematic/generator/restrictions/length.rb
schematic-0.4.4 lib/schematic/generator/restrictions/length.rb
schematic-0.4.3 lib/schematic/generator/restrictions/length.rb
schematic-0.4.2 lib/schematic/generator/restrictions/length.rb
schematic-0.4.1 lib/schematic/generator/restrictions/length.rb
schematic-0.4.0 lib/schematic/generator/restrictions/length.rb
schematic-0.3.8 lib/schematic/generator/restrictions/length.rb
schematic-0.3.7 lib/schematic/generator/restrictions/length.rb