Sha256: d990379150c954f275c670d5a8a25ecb47297123a8257621fba64fcf7ff3bf73

Contents?: true

Size: 1000 Bytes

Versions: 10

Compression:

Stored size: 1000 Bytes

Contents

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

module DataMapper
  module Validations
    module Fixtures
      class Reservation
        #
        # Behaviors
        #

        include ::DataMapper::Resource

        #
        # Attributes
        #

        attr_accessor :person_name_confirmation, :seats_confirmation

        #
        # Properties
        #

        property :id,              Serial
        property :person_name,     String,  :auto_validation => false
        property :number_of_seats, Integer, :auto_validation => false

        #
        # Validations
        #

        validates_confirmation_of :person_name,     :allow_nil => false, :allow_blank => false
        validates_confirmation_of :number_of_seats, :confirm => :seats_confirmation, :message => Proc.new { |resource, property|
          '%s requires confirmation for %s' % [DataMapper::Inflector.demodulize(resource.model.name), property.name]
        }
      end # Reservation
    end # Fixtures
  end # Validations
end # DataMapper

Version data entries

10 entries across 10 versions & 2 rubygems

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