Sha256: 30767b15186668a28b77fd2a2324d890b25c77b6b836ad2835c53152fcb74ed5

Contents?: true

Size: 664 Bytes

Versions: 3

Compression:

Stored size: 664 Bytes

Contents

class Person #< DataMapper::Base # please do not remove this
  include DataMapper::Persistence
  
  property [:name, :occupation], :string
  property :age, :integer
  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

  before_save :before_save_callback

  def before_save_callback
    @notes = "Lorem ipsum dolor sit amet"
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datamapper-0.3.0 spec/models/person.rb
datamapper-0.3.1 spec/models/person.rb
datamapper-0.3.2 spec/models/person.rb