Sha256: 7877a8db521d9a8496c7f1388ef090fcfc07542487cd0dc2aa2fb946ea0baea5

Contents?: true

Size: 467 Bytes

Versions: 4

Compression:

Stored size: 467 Bytes

Contents

class Category
  include Mongoid::Document
  include Mongoid::Timestamps
  include ActsAsList::Mongoid

  field :number, :type => Integer

  # field :pos, :type => Integer
  # acts_as_list :column => :pos

  #many should below in, or we will get:
  #NoMethodError:
  #       undefined method `entries' for #<Category:0x9acbaa8>
  referenced_in :category
  references_many :categories

  def scope_condition
    {:category_id => category.id, :pos.ne => nil}
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
acts_as_list_mongoid-0.2.5.1 model/referenced_category.rb
acts_as_list_mongoid-0.2.5 model/referenced_category.rb
acts_as_list_mongoid-0.2.4.1 model/referenced_category.rb
acts_as_list_mongoid-0.2.4 model/referenced_category.rb