Sha256: 20496215f4dfb0f9b51b6faf4ab31f0eb99c8ae124cf11f5719b64fd206ecb81

Contents?: true

Size: 967 Bytes

Versions: 6

Compression:

Stored size: 967 Bytes

Contents

class Address
  include MongoDoc::Document

  attr_accessor :street
  attr_accessor :city
  attr_accessor :state
  attr_accessor :zip_code
end

class Place
  include MongoDoc::Document

  attr_accessor :name
  attr_accessor :type
  embed :address
end

class Contact
  include MongoDoc::Document

  attr_accessor :name
  attr_accessor :type
  attr_accessor :note
  attr_accessor :interests
  embed_many :addresses

  scope :rubyists, any_in(:interests => ['ruby'])
  scope :contract_work, any_in(:interests => ['contract work'])
  scope :in_state, lambda {|state| where('addresses.state' => state)}
end

class Event
  include MongoDoc::Document

  attr_accessor :name
  attr_accessor :venue
  attr_accessor :date, :type => Date

  embed_hash :addresses
end

class Person
  include MongoDoc::Document

  attr_accessor :name
  references :address
  references_many :addresses, :as => :previous_addresses

  timestamps!
end

class VIP < Person
  attr_accessor :title
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mongo_doc-0.6.17 features/step_definitions/documents.rb
mongo_doc-0.6.16 features/step_definitions/documents.rb
mongo_doc-0.6.15 features/step_definitions/documents.rb
mongo_doc-0.6.14 features/step_definitions/documents.rb
mongo_doc-0.6.13 features/step_definitions/documents.rb
mongo_doc-0.6.12 features/step_definitions/documents.rb