RubyGems Navigation menu

julik-make_like_a_tree 1.0.3

Implement orderable trees in ActiveRecord using the nested set model, with multiple roots and scoping, and most importantly user-defined ordering of subtrees. Fetches preordered trees in one go, updates are write-heavy. This is a substantially butchered-up version/offspring of acts_as_threaded. The main additional perk is the ability to reorder nodes, which are always fetched ordered. Example: root = Folder.create! :name => "Main folder" subfolder_1 = Folder.create! :name => "Subfolder", :parent_id => root.id subfolder_2 = Folder.create! :name => "Another subfolder", :parent_id => root.id subfolder_2.move_to_top # just like acts_as_list but nestedly awesome root.all_children # => [subfolder_2, subfolder_1] See the rdocs for examples the method names. It also inherits the awesome properties of acts_as_threaded, namely materialized depth, root_id and parent_id values on each object which are updated when nodes get moved. Thanks to the authors of acts_as_threaded, awesome_nested_set, better_nested_set and all the others for inspiration.

Gemfile:
= 複製 已複製

安裝:
=

版本列表:

  1. 1.0.3 - August 11, 2014 (13.0 KB)
  2. 1.0.2 - August 11, 2014 (12.5 KB)
  3. 1.0.1 - August 11, 2014 (12.5 KB)

Runtime 相依性套件 (1):

hoe >= 1.8.2

作者:

  • Julik

SHA 256 checksum:

f4e2aaef8028c97323fc3e4fefcfdc73c9aa066e9b7590b8a0d82243a3195a03

總下載次數 8,035

這個版本 3,304

License:

Ruby 版本需求: >= 0

相關連結: