Sha256: ce26bd85171809d6148ed17649f34556c9de858ad8791b3750b30f19e133c3d0

Contents?: true

Size: 370 Bytes

Versions: 2

Compression:

Stored size: 370 Bytes

Contents

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

class City
  #
  # Behaviors
  #

  include DataMapper::Resource

  #
  # Properties
  #

  property :id,         Serial
  property :name,       String

  property :founded_in, Integer, :auto_validation => false

  #
  # Validations
  #

  validates_is_number :founded_in, :message => "Foundation year must be an integer"
end
City.auto_migrate!

Version data entries

2 entries across 2 versions & 1 rubygems

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