Sha256: 9761622c73cd51ec3f89c42f798537e458e7c35a291d138837888776b0cb1e0b

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

# -*- coding: utf-8 -*-

module DataMapper
  module Validation
    module Fixtures
      class LerneanHydra
        #
        # Behaviors
        #

        include DataMapper::Resource

        #
        # Properties
        #

        property :id,     Serial

        without_auto_validations do
          property :head_count, Float
        end

        #
        # Validations
        #

        validates_numericality_of :head_count, :eq => 9, :message => "Lernean hydra is said to have exactly 9 heads"

        def self.valid_instance(overrides = {})
          defaults = {
            :head_count => 9
          }

          new(defaults.merge(overrides))
        end
      end
    end # Fixtures
  end # Validations
end # DataMapper

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
sbf-dm-validations-1.4.0 spec/fixtures/lernean_hydra.rb
sbf-dm-validations-1.3.0 spec/fixtures/lernean_hydra.rb
sbf-dm-validations-1.3.0.beta spec/fixtures/lernean_hydra.rb
aequitas-0.0.1 spec_legacy/fixtures/lernean_hydra.rb