diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/awesome_nested_set/README.rdoc | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/awesome_nested_set/README.rdoc')
| -rw-r--r-- | vendor/plugins/awesome_nested_set/README.rdoc | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/vendor/plugins/awesome_nested_set/README.rdoc b/vendor/plugins/awesome_nested_set/README.rdoc deleted file mode 100644 index 884016db..00000000 --- a/vendor/plugins/awesome_nested_set/README.rdoc +++ /dev/null | |||
| @@ -1,79 +0,0 @@ | |||
| 1 | = AwesomeNestedSet | ||
| 2 | |||
| 3 | Awesome Nested Set is an implementation of the nested set pattern for ActiveRecord models. It is replacement for acts_as_nested_set and BetterNestedSet, but awesomer. It supports Rails 2.1 and later. | ||
| 4 | |||
| 5 | == What makes this so awesome? | ||
| 6 | |||
| 7 | This is a new implementation of nested set based off of BetterNestedSet that fixes some bugs, removes tons of duplication, adds a few useful methods, and adds STI support. | ||
| 8 | |||
| 9 | == Installation | ||
| 10 | |||
| 11 | Install as a plugin: | ||
| 12 | |||
| 13 | script/plugin install git://github.com/collectiveidea/awesome_nested_set.git | ||
| 14 | |||
| 15 | == Usage | ||
| 16 | |||
| 17 | To make use of awesome_nested_set, your model needs to have 3 fields: lft, rgt, and parent_id: | ||
| 18 | |||
| 19 | class CreateCategories < ActiveRecord::Migration | ||
| 20 | def self.up | ||
| 21 | create_table :categories do |t| | ||
| 22 | t.string :name | ||
| 23 | t.integer :parent_id | ||
| 24 | t.integer :lft | ||
| 25 | t.integer :rgt | ||
| 26 | end | ||
| 27 | end | ||
| 28 | |||
| 29 | def self.down | ||
| 30 | drop_table :categories | ||
| 31 | end | ||
| 32 | end | ||
| 33 | |||
| 34 | Enable the nested set functionality by declaring acts_as_nested_set on your model | ||
| 35 | |||
| 36 | class Category < ActiveRecord::Base | ||
| 37 | acts_as_nested_set | ||
| 38 | end | ||
| 39 | |||
| 40 | Run `rake rdoc` to generate the API docs and see CollectiveIdea::Acts::NestedSet::SingletonMethods for more info. | ||
| 41 | |||
| 42 | == View Helper | ||
| 43 | |||
| 44 | The view helper is called #nested_set_options. | ||
| 45 | |||
| 46 | Example usage: | ||
| 47 | |||
| 48 | <%= f.select :parent_id, nested_set_options(Category, @category) {|i| "#{'-' * i.level} #{i.name}" } %> | ||
| 49 | |||
| 50 | <%= select_tag 'parent_id', options_for_select(nested_set_options(Category) {|i| "#{'-' * i.level} #{i.name}" } ) %> | ||
| 51 | |||
| 52 | See CollectiveIdea::Acts::NestedSet::Helper for more information about the helpers. | ||
| 53 | |||
| 54 | == References | ||
| 55 | |||
| 56 | You can learn more about nested sets at: | ||
| 57 | |||
| 58 | http://www.dbmsmag.com/9603d06.html | ||
| 59 | http://threebit.net/tutorials/nestedset/tutorial1.html | ||
| 60 | http://api.rubyonrails.com/classes/ActiveRecord/Acts/NestedSet/ClassMethods.html | ||
| 61 | http://opensource.symetrie.com/trac/better_nested_set/ | ||
| 62 | |||
| 63 | == How to contribute | ||
| 64 | |||
| 65 | If you find what you might think is a bug: | ||
| 66 | |||
| 67 | 1. Check the GitHub issue tracker to see if anyone else has had the same issue. | ||
| 68 | http://github.com/collectiveidea/awesome_nested_set/issues/ | ||
| 69 | 2. If you don't see anything, create an issue with information on how to reproduce it. | ||
| 70 | |||
| 71 | If you want to contribute an enhancement or a fix: | ||
| 72 | |||
| 73 | 1. Fork the project on github. | ||
| 74 | http://github.com/collectiveidea/awesome_nested_set/ | ||
| 75 | 2. Make your changes with tests. | ||
| 76 | 3. Commit the changes without making changes to the Rakefile, VERSION, or any other files that aren't related to your enhancement or fix | ||
| 77 | 4. Send a pull request. | ||
| 78 | |||
| 79 | Copyright ©2008 Collective Idea, released under the MIT license \ No newline at end of file | ||
