Permalink
Browse files

Updating benchmark to treat address as a has_one, just to be sure.

  • Loading branch information...
1 parent fa094ce commit c079c9a8be35be55cce0d46afd7afed99cfadabb @durran durran committed Dec 26, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 perf/benchmark.rb
View
@@ -7,7 +7,7 @@ class Person < Mongoid::Document
include Mongoid::Versioning
field :birth_date, :type => Date
has_one :name
- has_many :addresses
+ has_one :address
has_many :phones
end
@@ -26,7 +26,7 @@ class Address < Mongoid::Document
field :state
field :post_code
field :type
- belongs_to :person, :inverse_of => :addresses
+ belongs_to :person, :inverse_of => :address
end
class Phone < Mongoid::Document
@@ -58,7 +58,7 @@ class Phone < Mongoid::Document
)
phone = Phone.new(:country_code => 1, :number => "415-555-1212", :type => "Mobile")
person.name = name
- person.addresses << address
+ person.address = address
person.phones << phone
person.save
end

0 comments on commit c079c9a

Please sign in to comment.