Sha256: 0177bfd927995538b99f3650fd603f13d400619efc9921d7c6254a4f2eea0322

Contents?: true

Size: 252 Bytes

Versions: 5

Compression:

Stored size: 252 Bytes

Contents

class Question
  include Mongoid::Document
  field :content
  embedded_in :survey, :inverse_of => :questions
  embeds_many :answers
  
  accepts_nested_attributes_for :answers, :reject_if => lambda { |a| a[:content].blank? }, :allow_destroy => true
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mongoid-eager-loading-0.2.0 spec/models/question.rb
mongoid-eager-loading-0.1.2 spec/models/question.rb
mongoid-eager-loading-0.1.1 spec/models/question.rb
mongoid-eager-loading-0.1.0 spec/models/question.rb
mongoid-locomotive-2.0.0.beta9 spec/models/question.rb