Sha256: ee1457931236aca8009d1acc51c641334e397c509fcc2c5b0a8fb443c618b67a

Contents?: true

Size: 286 Bytes

Versions: 1

Compression:

Stored size: 286 Bytes

Contents

class Exhibit #< DataMapper::Base
  include DataMapper::Persistence
  
  property :name, :string
  
  begin
  validates_presence_of :name
  rescue ArgumentError => e
    throw e unless e.message =~ /specify a unique key/
  end
  
  belongs_to :zoo
  has_and_belongs_to_many :animals
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper-0.2.5 spec/models/exhibit.rb