ActsAsList plugin
Pull request Compare This branch is 22 commits behind tomasc:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/mongo_mapper/acts
test
README
init.rb

README

This is a (quick and untested) port of classic +acts_as_list+ to Mongo Mapper.



ActsAsList
==========

This acts_as extension provides the capabilities for sorting and reordering a number of objects in a list. If you do not specify custom position +column+ in the options, a key named +position+ will be used automatically.


Example
=======

  class TodoList
    has_many :todo_items, :order => "position"
  end

  class TodoItem
		
		include MongoMapper::Document
		include MongoMapper::Acts::List
		
		key :todo_list_id, ObjectId
    belongs_to :todo_list

    acts_as_list :scope => :todo_list

  end

  todo_list.first.move_to_bottom
  todo_list.last.move_higher


Original acts_as_list Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license