Sha256: 9e43709e59756f56bfd784e55970fee6393af21230f1730b989bfa76a26b78c4

Contents?: true

Size: 808 Bytes

Versions: 6

Compression:

Stored size: 808 Bytes

Contents

module DataMapper
  module Validations
    module Fixtures
      # Mittelschauzer is a type of dog. The More You Know.
      class Mittelschnauzer

        #
        # Behaviors
        #

        include DataMapper::Resource

        #
        # Properties
        #

        without_auto_validations do
          property :name,   String, :key => true
          property :height, Float
        end

        attr_accessor :owner

        #
        # Validations
        #

        validates_length_of :name,  :min => 2, :allow_nil => false
        validates_length_of :owner, :min => 2

        validates_numericality_of :height, :lt => 55.2

        def self.valid_instance
          new(:name => "Roudolf Wilde", :height => 50.4, :owner => 'don')
        end
      end # Mittelschnauzer
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
ardm-validations-1.2.0 spec/fixtures/mittelschnauzer.rb
dm-validations-1.2.0 spec/fixtures/mittelschnauzer.rb
dm-validations-1.2.0.rc2 spec/fixtures/mittelschnauzer.rb
dm-validations-1.2.0.rc1 spec/fixtures/mittelschnauzer.rb
dm-validations-1.1.0 spec/fixtures/mittelschnauzer.rb
dm-validations-1.1.0.rc3 spec/fixtures/mittelschnauzer.rb