Sha256: 20cb31cbc041fb6166110d4c36de59a363e0be2fd1702365ba609bbb1a915cee

Contents?: true

Size: 291 Bytes

Versions: 2

Compression:

Stored size: 291 Bytes

Contents

class Animal
  include Mongoid::Document
  field :name
  field :tags, :type => Array
  key :name

  embedded_in :person

  accepts_nested_attributes_for :person

  def tag_list
    tags.join(", ")
  end

  def tag_list=(_tag_list)
    self.tags = _tag_list.split(",").map(&:strip)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-eager-loading-0.3.1 spec/models/animal.rb
mongoid-eager-loading-0.3.0 spec/models/animal.rb