Sha256: caa63ab2351f0b9e35b9f4ff067883c4bf4954fce52624c7807db65fb8a97fad

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 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
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongo_doc-0.4.2 features/step_definitions/documents.rb
mongo_doc-0.4.1 features/step_definitions/documents.rb
mongo_doc-0.4.0 features/step_definitions/documents.rb