Sha256: 4ac225ce2086c4ff8854c3e0b1337019058c3d05e48bd1b43e096a7dadb4f8aa

Contents?: true

Size: 1.05 KB

Versions: 7

Compression:

Stored size: 1.05 KB

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

class Character
  include MongoDoc::Document

  attr_accessor :name
  references :as_ref => :address
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mongo_doc-0.6.26 features/step_definitions/documents.rb
mongo_doc-0.6.25 features/step_definitions/documents.rb
mongo_doc-0.6.23 features/step_definitions/documents.rb
mongo_doc-0.6.22 features/step_definitions/documents.rb
mongo_doc-0.6.21 features/step_definitions/documents.rb
mongo_doc-0.6.20 features/step_definitions/documents.rb
mongo_doc-0.6.19 features/step_definitions/documents.rb