Sha256: ecda330fe94b70c515149e0d052ed1e0bc982f1cb7dc24138251d91b7f885e06

Contents?: true

Size: 278 Bytes

Versions: 5

Compression:

Stored size: 278 Bytes

Contents

class Animal
  include Mongoid::Document
  field :name
  field :tags, :type => Array  
  key :name
  embedded_in :person, :inverse_of => :pet
  
  def tag_list
    tags.join(", ")
  end
  
  def tag_list=(_tag_list)
    self.tags = _tag_list.split(",").map(&:strip)
  end  
end

Version data entries

5 entries across 5 versions & 2 rubygems

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