spec/models/preference.rb in mongoid-eager-loading-0.2.0 vs spec/models/preference.rb in mongoid-eager-loading-0.3.0
- old
+ new
@@ -1,7 +1,8 @@
class Preference
include Mongoid::Document
field :name
field :value
- references_many :people, :stored_as => :array, :inverse_of => :preferences
+ references_and_referenced_in_many :people
validates_length_of :name, :minimum => 2, :allow_nil => true
+ scope :posting, where(:value.in => [ "Posting" ])
end