Sha256: 135cba15eb2c8cd0b834ee4c5463fbda54d192e7bd0294ceb3d170b10d40bfa8

Contents?: true

Size: 701 Bytes

Versions: 2

Compression:

Stored size: 701 Bytes

Contents

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

module DataMapper
  module Validate
    module Fixtures
      class BasketballPlayer
        #
        # Behaviors
        #

        include DataMapper::Resource

        #
        # Properties
        #

        property :id,     Serial

        without_auto_validations do
          property :name,   String
          property :height, Float
          property :weight, Float
        end

        #
        # Validations
        #

        # precision and scale need to be defined for length to be validated
        validates_is_number :height, :weight, :precision => 10
      end
      BasketballPlayer.auto_migrate!


    end # Fixtures
  end # Validate
end # DataMapper

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dm-validations-0.10.1 spec/fixtures/basketball_player.rb
dm-validations-0.10.0 spec/fixtures/basketball_player.rb