spec/models/person.rb in mongoid-pre-2.0.0.beta1 vs spec/models/person.rb in mongoid-pre-2.0.0.pre

- old
+ new

@@ -2,52 +2,50 @@ include Mongoid::Document include Mongoid::Timestamps field :title field :terms, :type => Boolean - field :pets, :type => Boolean, :default => false field :age, :type => Integer, :default => 100 field :dob, :type => Date field :mixed_drink, :type => MixedDrink field :employer_id field :lunch_time, :type => Time field :aliases, :type => Array field :map, :type => Hash field :score, :type => Integer field :blood_alcohol_content, :type => Float, :default => lambda{ 0.0 } field :ssn - field :owner_id, :accessible => false, :type => Integer index :age index :addresses index :dob index :name index :title index :ssn, :unique => true attr_reader :rescored - embeds_many :addresses do + has_many :addresses do def extension "Testing" end def find_by_street(street) @target.select { |doc| doc.street == street } end end - embeds_many :phone_numbers, :class_name => "Phone" + has_many :phone_numbers, :class_name => "Phone" - embeds_one :name do + has_one :name do def extension "Testing" end def dawkins? first_name == "Richard" && last_name == "Dawkins" end end - embeds_one :pet, :class_name => "Animal" + has_one :pet, :class_name => "Animal" accepts_nested_attributes_for :addresses, :reject_if => lambda { |attrs| attrs["street"].blank? } accepts_nested_attributes_for :name has_one_related :game do