Sha256: 2c8df78aa532909a5fc3c54bbf1b7e57bc7ac779a68de8e93d42e7f2f217141b
Contents?: true
Size: 900 Bytes
Versions: 3
Compression:
Stored size: 900 Bytes
Contents
module DataMapper module Validate module Fixtures class Currency # # Behaviors # include DataMapper::Resource # # Properties # without_auto_validations do property :name, String, :length => 1..50, :key => true property :code, String, :length => 3, :unique_index => true property :symbol, String, :length => 1 end # # Validations # validates_length :name, :within => 1..50 validates_length :code, :is => 3 validates_length :symbol, :is => 1 def self.valid_instance(overrides = {}) defaults = { :name => 'United States Dollar', :code => 'USD', :symbol => '$' } new(defaults.merge(overrides)) end end # Barcode end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
dm-validations-0.10.2 | spec/fixtures/currency.rb |
dm-validations-0.10.1 | spec/fixtures/currency.rb |
dm-validations-0.10.0 | spec/fixtures/currency.rb |