Sha256: d25b5c4daad3a96fbaf01828a78e9c1f05e1a09aabbe845a5212ae2ea864c9ea

Contents?: true

Size: 534 Bytes

Versions: 5

Compression:

Stored size: 534 Bytes

Contents

require 'hydra/validations/enumerable_behavior'

module Hydra
  module Validations
    #
    # FormatValidator - Add EnumerableBehavior to ActiveModel's FormatValidator
    #
    # See ActiveModel::Validations::FormatValidator for usage and options.
    #
    class FormatValidator < ActiveModel::Validations::FormatValidator
      include EnumerableBehavior
    end

    module HelperMethods
      def validates_format_of *attr_names
        validates_with FormatValidator, _merge_attributes(attr_names)
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hydra-validations-0.5.0 lib/hydra/validations/format.rb
hydra-validations-0.4.0 lib/hydra/validations/format.rb
hydra-validations-0.3.2 lib/hydra/validations/format.rb
hydra-validations-0.3.1 lib/hydra/validations/format.rb
hydra-validations-0.3.0 lib/hydra/validations/format.rb