Sha256: 13fde3e6f832dc74cf0074efad8c82b24cb5994752dcb3960939b4341cd2900f

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

class Person < DataMapper::Base
  property :name, :string
  property :age, :integer
  property :occupation, :string
  property :type, :class
  property :notes, :text
  property :date_of_birth, :date
  
  embed :address, :prefix => true do
    property :street, :string
    property :city, :string
    property :state, :string, :size => 2
    property :zip_code, :string, :size => 10
    
    def city_state_zip_code
      "#{city}, #{state} #{zip_code}"
    end
    
  end
  
  belongs_to :career
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
datamapper-0.2.4 spec/models/person.rb