Sha256: 7ad251bb103a2313a67707b346d0be3410e288181d2cbf99317073760137dd77

Contents?: true

Size: 841 Bytes

Versions: 2

Compression:

Stored size: 841 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

  timestamps!
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongo_doc-0.6.5 features/step_definitions/documents.rb
mongo_doc-0.6.4 features/step_definitions/documents.rb