Socket
Book a DemoInstallSign in
Socket

mongo_mapper_acts_as_list

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo_mapper_acts_as_list

0.3.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

= mongo_mapper_acts_as_list

This is a port of classic Rails' {acts_as_list}[http://github.com/rails/acts_as_list] to Mongo Mapper. This MongoMapper plugin 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 added and used by default.

It has (almost) the same functionality and passes the original test-suite. Scope needs to be defined as symbol or array of symbols. It does not work for Embedded Documents.

== Installation

Add this to your Gemfile and run the +bundle+ command:

gem 'mongo_mapper_acts_as_list'

== Example

class TodoList include MongoMapper::Document

many :todo_items, :order => "position"

end

class TodoItem include MongoMapper::Document include MongoMapper::Plugins::ActsAsList

key :todo_list_id, ObjectId
belongs_to :todo_list

acts_as_list :scope => :todo_list_id

end

todo_list.first.move_to_bottom todo_list.last.move_higher

== Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

== Copyright

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

FAQs

Package last updated on 23 Oct 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.