
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
mongo_mapper_acts_as_tree
Advanced tools
= mongo_mapper_acts_as_tree
This is a port of classic Rails {acts_as_tree}[http://github.com/rails/acts_as_tree] to Mongo Mapper. Specify this MongoMapper plugin if you want to model a tree structure by providing a parent association and a children association. This requires that you have a foreign key, which by default is called parent_id.
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 (by principle) for Embedded Documents. Please note, it is not yet optimized and therefore issues more queries than necessary.
== Installation
mongo_mapper_acts_as_list is available as RubyGem:
gem install mongo_mapper_acts_as_tree
== Example
class Category include MongoMapper::Document
plugin MongoMapper::Plugins::ActsAsTree
key :parent_id, ObjectId
acts_as_tree :order => :name
end
Example: root _ child1 _ subchild1 _ subchild2
root = Category.create(:name => "root") child1 = root.children.create(:name => "child1") subchild1 = child1.children.create(:name => "subchild1")
root.parent # => nil child1.parent # => root root.children # => [child1] root.children.first.children.first # => subchild1
== Note on Patches/Pull Requests
== Copyright
Original Rails acts_as_tree Copyright (c) 2007 David Heinemeier Hansson, released under the MIT license
FAQs
Unknown package
We found that mongo_mapper_acts_as_tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.