Sha256: 68bf2628c05bce1198ac88c757c3e0c3355377db8f2755308b2e17ed56ff8631
Contents?: true
Size: 400 Bytes
Versions: 1
Compression:
Stored size: 400 Bytes
Contents
class Zoo #< DataMapper::Base include DataMapper::Persistence property :name, :string property :notes, :text property :updated_at, :datetime has_many :exhibits begin validates_presence_of :name rescue ArgumentError => e throw e unless e.message =~ /specify a unique key/ end def name=(val) @name = (val == "Colorado Springs") ? "Cheyenne Mountain" : val end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
datamapper-0.2.5 | spec/models/zoo.rb |