New Upstream Release - ruby-awesome-nested-set
Ready changes
Summary
Merged new upstream version: 3.5.0 (was: 3.0.0).
Resulting package
Built on 2022-03-14T10:55 (took 2m50s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases ruby-awesome-nested-set
Lintian Result
Diff
diff --git a/CHANGELOG b/CHANGELOG
index 567c8cb..ac95cea 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,8 +1,82 @@
+Unreleased version
+
+3.5.0
+* Support Rails 7.0.0 [Peter Berkenbosch](https://github.com/peterberkenbosch) and [Andrew Hampton](https://github.com/andrewhampton)
+* Make `order_column` option more flexible by removing explicit `=> :asc` [Regis Millet](https://github.com/Kulgar)
+* Updated README to use latest migration syntax [Justin MacCarthy](https://github.com/macarthy)
+* [Compare to 3.4.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.4.0...v3.5.0)
+
+3.4.0
+* Keep current scope when calling `roots` [Petrik de Heus](https://github.com/p8)
+* STI record now can update counter cache correctly [Issei Murasawa](http://github.com/issei-m)
+* [Compare to 3.3.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.1...v3.4.0)
+
+3.3.1
+* Add belongs_to :polymorphic key option only when used [Filippo Liverani](https://github.com/filippoliverani)
+* [Compare to 3.3.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.0...v3.3.1)
+
+3.3.0
+* Update for compatibility with Rails 6.1 which no longer inherits scoping
+ (Messages of the form "DEPRECATION WARNING: Class level methods will no longer inherit scoping from ...") [Marc Rohloff](https://github.com/marcrohloff)
+* Fix ruby 2.7 keyword parameters deprecation warning [Krisdigital](https://github.com/krisdigital)
+* [Compare to 3.2.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.2.1...v3.3.0)
+
+3.2.1
+* Don't reload in after_save callback. [Petrik de Heus](https://github.com/p8)
+* Fix deprecation warning "Passing a range to `#in` is deprecated". [Konstantin Mochalov](https://github.com/kolen)
+* [Compare to 3.2.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.2.0...v3.2.1)
+
+3.2.0
+* Add support for Rails 6.0 [Stefan Andersen](https://github.com/stfnndrsn) and [Damian Legawiec](https://github.com/damianlegawiec) and [Jonathan Tapia](https://github.com/jtapia) and [Alex](https://github.com/a-ta-ta)
+* [Compare to 3.1.4](https://github.com/collectiveidea/awesome_nested_set/compare/v3.1.4...v3.2.0)
+
+3.1.4
+* Add support for Rails 5.2 [John Hawthorn](https://github.com/jhawthorn) and [marocchino](https://github.com/marocchino)
+* [Compare to 3.1.3](https://github.com/collectiveidea/awesome_nested_set/compare/v3.1.3...v3.1.4)
+
+3.1.3
+* Add support for Rails 5.1 [John Hawthorn](https://github.com/jhawthorn)
+* [Compare to 3.1.2](https://github.com/collectiveidea/awesome_nested_set/compare/v3.1.2...v3.1.3)
+
+3.1.2
+* Make belongs_to relation optional again [Jan Matusz](https://marahin.pl/)
+* [Compare to 3.0.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.1.1...v3.1.2)
+
+3.1.1
+* Fix a reloading bug when using default scope [Krzysztof Rybka](https://github.com/krzysiek1507)
+* [Compare to 3.1.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.1.0...v3.1.1)
+
+3.1.0
+* Ensure that nested_set queries respect the model's default_scope. [oesgalha](https://github.com/oesgalha)
+* Add Rails 5 support [Krzysztof Rybka](https://github.com/krzysiek1507)
+* Drop support for ruby 1.9.3 [Krzysztof Rybka](https://github.com/krzysiek1507)
+* Fix .all_roots_valid? method when model is ordered by default [Adam Hodowany](https://github.com/hodak)
+* Reuse the current model's connection when available [Tim Bugai] [#322](https://github.com/collectiveidea/awesome_nested_set/pull/322)
+* [Compare to 3.0.3](https://github.com/collectiveidea/awesome_nested_set/compare/v3.0.3...v3.1.0)
+
+3.0.3
+* Add :nullify option to :dependent functionality to orphan children rather
+than destroy them.
+* [Compare to 3.0.2](https://github.com/collectiveidea/awesome_nested_set/compare/v3.0.2...v3.0.3)
+
+3.0.2
+* Fix `dependent: :restrict_with_exception` not allowing a delete to occur. [Brendan Kilfoil]
+* Replace `Arel::SelectManager#join_sql` with `Arel::SelectManager#join_sources` as `Arel::Node#joins` accepts AST as well. [Swanand Pagnis]
+* Corrected nested_set_scope usage. [Finbarr Taylor] [#292](https://github.com/collectiveidea/awesome_nested_set/pull/292)
+* Fix bug: when model with default_scope make #lft and #rgt wrong [eddie](https://github.com/afunction) [#281](https://github.com/collectiveidea/awesome_nested_set/pull/281)
+* [Compare to 3.0.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.0.1...v3.0.2)
+
+3.0.1
+* Fixed `dependent: :destroy` when called from associated object. #162 [Kuldeep Aggarwal]
+* [Compare to 3.0.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.0.0...v3.0.1)
+
3.0.0
* Support Rails 4.1 [Micah Geisel]
* Support dependent: restrict_with_error [Tiago Moraes]
* Added information to the README regarding indexes to be added for performance [bdarfler]
* Modified associate_parents to add child objects to the parent#children collection [Tiago Moraes]
+* Fix `dependent: :restrict_with_exception` not allowing a delete to occur. [Brendan Kilfoil]
+* [Compare to v2.1.6](https://github.com/collectiveidea/awesome_nested_set/compare/v2.1.6...v3.0.0)
2.1.6
* Fixed rebuild! when there is a default_scope with order [Adrian Serafin]
diff --git a/README.md b/README.md
index 7da6445..6e40a1a 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,13 @@
# Awesome Nested Set
-[![Build Status](https://travis-ci.org/collectiveidea/awesome_nested_set.png?branch=master)](https://travis-ci.org/collectiveidea/awesome_nested_set) [![Code Climate](https://codeclimate.com/github/collectiveidea/awesome_nested_set.png)](https://codeclimate.com/github/collectiveidea/awesome_nested_set) [![Dependency Status](https://gemnasium.com/collectiveidea/awesome_nested_set.svg)](https://gemnasium.com/collectiveidea/awesome_nested_set)
+[![CI](https://github.com/collectiveidea/awesome_nested_set/actions/workflows/ci.yml/badge.svg)](https://github.com/collectiveidea/awesome_nested_set/actions/workflows/ci.yml) [![Code Climate](https://codeclimate.com/github/collectiveidea/awesome_nested_set.svg)](https://codeclimate.com/github/collectiveidea/awesome_nested_set) [![Security](https://hakiri.io/github/collectiveidea/awesome_nested_set/master.svg)](https://hakiri.io/github/collectiveidea/awesome_nested_set/master)
Awesome Nested Set is an implementation of the nested set pattern for ActiveRecord models.
It is a replacement for acts_as_nested_set and BetterNestedSet, but more awesome.
-Version 3 supports Rails 4. Version 2 supports Rails 3. Gem versions prior to 2.0 support Rails 2.
+Version 3.2 supports Rails 6, 3.1 supports Rails 5 & 4. Version 2 supports Rails 3.
+Gem versions prior to 2.0 support Rails 2.
## What makes this so awesome?
@@ -23,25 +24,27 @@ gem 'awesome_nested_set'
## Usage
-To make use of `awesome_nested_set`, your model needs to have 3 fields:
+To make use of `awesome_nested_set` your model needs to have 3 fields:
`lft`, `rgt`, and `parent_id`. The names of these fields are configurable.
-You can also have an optional field, `depth`:
+You can also have optional fields: `depth` and `children_count`. These fields are configurable.
+Note that the `children_count` column must have `null: false` and `default: 0` to
+function properly.
```ruby
class CreateCategories < ActiveRecord::Migration
- def self.up
+ def change
create_table :categories do |t|
t.string :name
- t.integer :parent_id
- t.integer :lft
- t.integer :rgt
- t.integer :depth # this is optional.
+ t.integer :parent_id, null: true, index: true
+ t.integer :lft, null: false, index: true
+ t.integer :rgt, null: false, index: true
+
+ # optional fields
+ t.integer :depth, null: false, default: 0
+ t.integer :children_count, null: false, default: 0
+ t.timestamps
end
end
-
- def self.down
- drop_table :categories
- end
end
```
@@ -60,13 +63,15 @@ Run `rake rdoc` to generate the API docs and see [CollectiveIdea::Acts::NestedSe
You can pass various options to `acts_as_nested_set` macro. Configuration options are:
* `parent_column`: specifies the column name to use for keeping the position integer (default: parent_id)
-* `left_column`: column name for left boundry data (default: lft)
-* `right_column`: column name for right boundry data (default: rgt)
+* `primary_column`: specifies the column name to use as the inverse of the parent column (default: id)
+* `left_column`: column name for left boundary data (default: lft)
+* `right_column`: column name for right boundary data (default: rgt)
* `depth_column`: column name for the depth data default (default: depth)
-* `scope`: restricts what is to be considered a list. Given a symbol, it'll attach “_id” (if it hasn't been already) and use that as the foreign key restriction. You can also pass an array to scope by multiple attributes. Example: `acts_as_nested_set :scope => [:notable_id, :notable_type]`
-* `dependent`: behavior for cascading destroy. If set to :destroy, all the child objects are destroyed alongside this object by calling their destroy method. If set to :delete_all (default), all the child objects are deleted without calling their destroy method.
+* `scope`: restricts what is to be considered a list. Given a symbol, it'll attach `_id` (if it hasn't been already) and use that as the foreign key restriction. You can also pass an array to scope by multiple attributes. Example: `acts_as_nested_set :scope => [:notable_id, :notable_type]`
+* `dependent`: behavior for cascading destroy. If set to :destroy, all the child objects are destroyed alongside this object by calling their destroy method. If set to :delete_all (default), all the child objects are deleted without calling their destroy method. If set to :nullify, all child objects will become orphaned and become roots themselves.
* `counter_cache`: adds a counter cache for the number of children. defaults to false. Example: `acts_as_nested_set :counter_cache => :children_count`
* `order_column`: on which column to do sorting, by default it is the left_column_name. Example: `acts_as_nested_set :order_column => :position`
+* `touch`: If set to `true`, then the updated_at timestamp on the ancestors will be set to the current time whenever this object is saved or destroyed (default: false)
See [CollectiveIdea::Acts::NestedSet::Model::ClassMethods](/lib/awesome_nested_set/model.rb#L26) for a list of class methods and [CollectiveIdea::Acts::NestedSet::Model](lib/awesome_nested_set/model.rb#L13) for a list of instance methods added to acts_as_nested_set models
@@ -129,7 +134,7 @@ class Category < ActiveRecord::Base
end
```
-## Protecting attributes from mass assignment
+## Protecting attributes from mass assignment (for Rails < 4)
It's generally best to "whitelist" the attributes that can be used in mass assignment:
@@ -154,7 +159,7 @@ end
To make use of `awesome_nested_set`, your model needs to have 3 fields:
`lft`, `rgt`, and `parent_id`. The names of these fields are configurable.
-You can also have an optional field, `depth`.
+You can also have optional fields, `depth` and `children_count`.
Create a migration to add fields:
@@ -164,11 +169,15 @@ class AddNestedToCategories < ActiveRecord::Migration
def self.up
add_column :categories, :parent_id, :integer # Comment this line if your project already has this column
# Category.where(parent_id: 0).update_all(parent_id: nil) # Uncomment this line if your project already has :parent_id
- add_column :categories, :lft , :integer
- add_column :categories, :rgt , :integer
- add_column :categories, :depth , :integer # this is optional.
+ add_column :categories, :lft, :integer
+ add_column :categories, :rgt, :integer
+
+ # optional fields
+ add_column :categories, :depth, :integer
+ add_column :categories, :children_count, :integer
# This is necessary to update :lft and :rgt columns
+ Category.reset_column_information
Category.rebuild!
end
@@ -176,7 +185,10 @@ class AddNestedToCategories < ActiveRecord::Migration
remove_column :categories, :parent_id
remove_column :categories, :lft
remove_column :categories, :rgt
- remove_column :categories, :depth # this is optional.
+
+ # optional fields
+ remove_column :categories, :depth
+ remove_column :categories, :children_count
end
end
@@ -203,6 +215,8 @@ Category.rebuild!
Your tree will be converted to a valid nested set. Awesome!
+Note: You can use `Category.rebuild!(false)` to skip model validations when performing the rebuild.
+
## View Helper
The view helper is called #nested_set_options.
@@ -217,12 +231,8 @@ Example usage:
See [CollectiveIdea::Acts::NestedSet::Helper](lib/awesome_nested_set/helper.rb) for more information about the helpers.
-## References
-
-You can learn more about nested sets at: http://threebit.net/tutorials/nestedset/tutorial1.html
-
## How to contribute
Please see the ['Contributing' document](CONTRIBUTING.md).
-Copyright © 2008 - 2014 Collective Idea, released under the MIT license
+Copyright © 2008–2015 [Collective Idea](http://collectiveidea.com), released under the MIT license.
diff --git a/awesome_nested_set.gemspec b/awesome_nested_set.gemspec
new file mode 100644
index 0000000..64cc867
--- /dev/null
+++ b/awesome_nested_set.gemspec
@@ -0,0 +1,48 @@
+#########################################################
+# This file has been automatically generated by gem2tgz #
+#########################################################
+# -*- encoding: utf-8 -*-
+# stub: awesome_nested_set 3.5.0 ruby lib
+
+Gem::Specification.new do |s|
+ s.name = "awesome_nested_set".freeze
+ s.version = "3.5.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
+ s.require_paths = ["lib".freeze]
+ s.authors = ["Brandon Keepers".freeze, "Daniel Morrison".freeze, "Philip Arndt".freeze]
+ s.cert_chain = ["-----BEGIN CERTIFICATE-----\nMIIEMjCCApqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhnZW1z\nL0RDPXAvREM9YXJuZHQvREM9aW8wHhcNMjEwNjIzMDkyNzU2WhcNMjIwNjIzMDky\nNzU2WjAjMSEwHwYDVQQDDBhnZW1zL0RDPXAvREM9YXJuZHQvREM9aW8wggGiMA0G\nCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQD0CYnD37uLlJ3Urla2EnnUQ8S6s16k\nAGMpAzpmARo8YwSqtYMJVGyBzUeI7y93Fk9ncswhIFSH/hnh/Ouat/ki9flHlZ+w\nanv0M+9v3wCLyZSC5BQIWpoduFM/fuvLoDUJDWxL50RjwMS0qo2x2LvfQdHN8gn3\nJdSIV5WLJKIvlmIl9S3pw0JO5KRUGn1PcBO7C0S0SlbhVjRHtlao1ycWUULsX109\nhCh39MPGtnZpdCcxheh0TH/UA/jV0/du9/rQdoidkNHkaC24pPfBJ3nS+rAbWaHP\nWmP+0rjfk/XnGBu/HZpKvlnwQjP3QdK4UMtWl8zewqFMNcIiBRALQugnL/SfrP/4\nCSlha9LwkiE6ByeY4WGnNjNqpi5J3IzjEkZRAxG7u9gCB3FzTaBTyXZYI6jplYNw\nTcCJIBHuoPaa+m9brpjb3Uv94nfM97ZP+OmpGYCCAMq4TT7OOV+t8wJc0w8bb0FO\nROhmVNTxrBaNcl6MkZn88EMRCsGgoWklOG0CAwEAAaNxMG8wCQYDVR0TBAIwADAL\nBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFGu7pbmeILyHnBmannuaNRfdN8MsMBoGA1Ud\nEQQTMBGBD2dlbXNAcC5hcm5kdC5pbzAaBgNVHRIEEzARgQ9nZW1zQHAuYXJuZHQu\naW8wDQYJKoZIhvcNAQELBQADggGBANlxc4uAnkPC3zbztG7uZfBfn4HSuvv655Pa\nUaYZ6hNETFrqg78mGs3PkFe2Ru7cVWwckbmH46aq50QoNnx4ClxT03vr03n76Jg1\n8WWHkf0+rcINFlbtIFcmcFrois5Ow3n7pH+xstDtzoWcbh41WwuZStNhrIYsnjAK\n/ovz8D5JlboxceOpVLB/0NiqNEWltK+EMQHmX25Sqf/r5o5rAL9zwEKPFp1Y5X+z\nt2jBjYt2ymr1eMWxux6e+N2uKZL4MblHawxvKlI8UHsIiV9xrc4BwlwlbitcvNIL\nZykdSlpTJd0Guy92iYjCJMC09tMRUNxiVBwD3jRGSeW9YAPIZGXIcVlm6srIRDjJ\no8wB6oOvHAkRXnntOo/4bBDH+ehmgvhh/O/mI+au6C0M430fv+ooH0w08LEXLx1k\ne17ZNASZffbQRP09MH2GZ2AOlkildTX6looWRforZEZi+qamognrozd3MI5QHi1W\nUAZUzHLrrFu7gnkFvLVpxOUf4ItOkA==\n-----END CERTIFICATE-----\n".freeze]
+ s.date = "2022-02-08"
+ s.description = "An awesome nested set implementation for Active Record".freeze
+ s.email = "info@collectiveidea.com".freeze
+ s.extra_rdoc_files = ["README.md".freeze]
+ s.files = ["CHANGELOG".freeze, "MIT-LICENSE".freeze, "README.md".freeze, "lib/awesome_nested_set.rb".freeze, "lib/awesome_nested_set/awesome_nested_set.rb".freeze, "lib/awesome_nested_set/columns.rb".freeze, "lib/awesome_nested_set/helper.rb".freeze, "lib/awesome_nested_set/iterator.rb".freeze, "lib/awesome_nested_set/model.rb".freeze, "lib/awesome_nested_set/model/movable.rb".freeze, "lib/awesome_nested_set/model/prunable.rb".freeze, "lib/awesome_nested_set/model/rebuildable.rb".freeze, "lib/awesome_nested_set/model/relatable.rb".freeze, "lib/awesome_nested_set/model/transactable.rb".freeze, "lib/awesome_nested_set/model/validatable.rb".freeze, "lib/awesome_nested_set/move.rb".freeze, "lib/awesome_nested_set/set_validator.rb".freeze, "lib/awesome_nested_set/tree.rb".freeze, "lib/awesome_nested_set/version.rb".freeze]
+ s.homepage = "https://github.com/collectiveidea/awesome_nested_set".freeze
+ s.licenses = ["MIT".freeze]
+ s.rdoc_options = ["--main".freeze, "README.md".freeze, "--inline-source".freeze, "--line-numbers".freeze]
+ s.required_ruby_version = Gem::Requirement.new(">= 2.0.0".freeze)
+ s.rubygems_version = "3.2.5".freeze
+ s.summary = "An awesome nested set implementation for Active Record".freeze
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 4
+ end
+
+ if s.respond_to? :add_runtime_dependency then
+ s.add_runtime_dependency(%q<activerecord>.freeze, [">= 4.0.0", "< 7.1"])
+ s.add_development_dependency(%q<appraisal>.freeze, [">= 0"])
+ s.add_development_dependency(%q<database_cleaner>.freeze, [">= 0"])
+ s.add_development_dependency(%q<pry>.freeze, [">= 0"])
+ s.add_development_dependency(%q<pry-nav>.freeze, [">= 0"])
+ s.add_development_dependency(%q<rake>.freeze, ["~> 12"])
+ s.add_development_dependency(%q<rspec-rails>.freeze, ["~> 4.0.0"])
+ else
+ s.add_dependency(%q<activerecord>.freeze, [">= 4.0.0", "< 7.1"])
+ s.add_dependency(%q<appraisal>.freeze, [">= 0"])
+ s.add_dependency(%q<database_cleaner>.freeze, [">= 0"])
+ s.add_dependency(%q<pry>.freeze, [">= 0"])
+ s.add_dependency(%q<pry-nav>.freeze, [">= 0"])
+ s.add_dependency(%q<rake>.freeze, ["~> 12"])
+ s.add_dependency(%q<rspec-rails>.freeze, ["~> 4.0.0"])
+ end
+end
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
deleted file mode 100644
index e9d842d..0000000
Binary files a/checksums.yaml.gz and /dev/null differ
diff --git a/checksums.yaml.gz.sig b/checksums.yaml.gz.sig
new file mode 100644
index 0000000..9caa908
--- /dev/null
+++ b/checksums.yaml.gz.sig
@@ -0,0 +1,2 @@
+̗
�:ǿ������1@+�b4��{$��/��[_I���cc�7ډk&�럪��#���Z�7%���$��/�V�z^{��IwIvޞ=���u\�F�C?ƾGG��>�2N��ʪG���yH�����V���\?(�� ����p�U�F��o�Xo�n��wRz���b��fM%�P�z���v���hL{���r�O�E|����td+5��g!���y�ŏy؞��^
+M�7kAlz�ឞ ��d�֛"L��6�{� `�X�f��$ay�<4���o,MjN��F�D3�2�`a�����WBg�F����E��Q�-B'�����_��s6�@%s5� ���9�dN�<��[X7lH�C�Ck7��B{�-����=
\ No newline at end of file
diff --git a/data.tar.gz.sig b/data.tar.gz.sig
new file mode 100644
index 0000000..7791ee2
Binary files /dev/null and b/data.tar.gz.sig differ
diff --git a/debian/changelog b/debian/changelog
index 79c82bd..4b00472 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-ruby-awesome-nested-set (3.0.0-2) UNRELEASED; urgency=medium
+ruby-awesome-nested-set (3.5.0-1) UNRELEASED; urgency=medium
[ Cédric Boutillier ]
* Bump debhelper compatibility level to 9
@@ -28,8 +28,9 @@ ruby-awesome-nested-set (3.0.0-2) UNRELEASED; urgency=medium
* Update watch file format version to 4.
* Apply multi-arch hints.
+ ruby-awesome-nested-set: Add :any qualifier for ruby dependency.
+ * New upstream release.
- -- Utkarsh Gupta <guptautkarsh2102@gmail.com> Tue, 13 Aug 2019 03:30:55 +0530
+ -- Utkarsh Gupta <guptautkarsh2102@gmail.com> Mon, 14 Mar 2022 10:53:04 -0000
ruby-awesome-nested-set (3.0.0-1) unstable; urgency=medium
diff --git a/lib/awesome_nested_set.rb b/lib/awesome_nested_set.rb
index 37ae517..8789cd6 100644
--- a/lib/awesome_nested_set.rb
+++ b/lib/awesome_nested_set.rb
@@ -1,8 +1,11 @@
+require 'active_support/lazy_load_hooks'
require 'awesome_nested_set/awesome_nested_set'
-require 'active_record'
-ActiveRecord::Base.send :extend, CollectiveIdea::Acts::NestedSet
-if defined?(ActionView)
+ActiveSupport.on_load(:active_record) do
+ ActiveRecord::Base.send :extend, CollectiveIdea::Acts::NestedSet
+end
+
+ActiveSupport.on_load(:action_view) do
require 'awesome_nested_set/helper'
ActionView::Base.send :include, CollectiveIdea::Acts::NestedSet::Helper
end
diff --git a/lib/awesome_nested_set/awesome_nested_set.rb b/lib/awesome_nested_set/awesome_nested_set.rb
index 146c33e..b395d91 100644
--- a/lib/awesome_nested_set/awesome_nested_set.rb
+++ b/lib/awesome_nested_set/awesome_nested_set.rb
@@ -5,7 +5,7 @@ module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
- # This acts provides Nested Set functionality. Nested Set is a smart way to implement
+ # This provides Nested Set functionality. Nested Set is a smart way to implement
# an _ordered_ tree, with the added feature that you can select the children and all of their
# descendants with a single query. The drawback is that insertion or move need some complex
# sql queries. But everything is done here by this module!
@@ -15,8 +15,8 @@ module CollectiveIdea #:nodoc:
#
# == API
#
- # Methods names are aligned with acts_as_tree as much as possible to make replacment from one
- # by another easier.
+ # Methods names are aligned with acts_as_tree as much as possible to make transition from one
+ # to another easier.
#
# item.children.create(:name => "child1")
#
@@ -25,8 +25,8 @@ module CollectiveIdea #:nodoc:
#
# * +:parent_column+ - specifies the column name to use for keeping the position integer (default: parent_id)
# * +:primary_column+ - specifies the column name to use as the inverse of the parent column (default: id)
- # * +:left_column+ - column name for left boundry data, default "lft"
- # * +:right_column+ - column name for right boundry data, default "rgt"
+ # * +:left_column+ - column name for left boundary data, default "lft"
+ # * +:right_column+ - column name for right boundary data, default "rgt"
# * +:depth_column+ - column name for the depth data, default "depth"
# * +:scope+ - restricts what is to be considered a list. Given a symbol, it'll attach "_id"
# (if it hasn't been already) and use that as the foreign key restriction. You
@@ -87,18 +87,22 @@ module CollectiveIdea #:nodoc:
) if acts_as_nested_set_options[ar_callback]
end
- has_many :children, -> { order(quoted_order_column_name) },
- has_many_children_options
+ has_many :children, -> { order(order_column_name) },
+ **has_many_children_options
end
def acts_as_nested_set_relate_parent!
- belongs_to :parent, :class_name => self.base_class.to_s,
- :foreign_key => parent_column_name,
- :primary_key => primary_column_name,
- :counter_cache => acts_as_nested_set_options[:counter_cache],
- :inverse_of => (:children unless acts_as_nested_set_options[:polymorphic]),
- :polymorphic => acts_as_nested_set_options[:polymorphic],
- :touch => acts_as_nested_set_options[:touch]
+ options = {
+ :class_name => self.base_class.to_s,
+ :foreign_key => parent_column_name,
+ :primary_key => primary_column_name,
+ :counter_cache => acts_as_nested_set_options[:counter_cache],
+ :inverse_of => (:children unless acts_as_nested_set_options[:polymorphic]),
+ :touch => acts_as_nested_set_options[:touch]
+ }
+ options[:polymorphic] = true if acts_as_nested_set_options[:polymorphic]
+ options[:optional] = true if ActiveRecord::VERSION::MAJOR >= 5
+ belongs_to :parent, **options
end
def acts_as_nested_set_default_options
diff --git a/lib/awesome_nested_set/columns.rb b/lib/awesome_nested_set/columns.rb
index b796607..7ad5c60 100644
--- a/lib/awesome_nested_set/columns.rb
+++ b/lib/awesome_nested_set/columns.rb
@@ -23,7 +23,7 @@ module CollectiveIdea #:nodoc:
acts_as_nested_set_options[:primary_column]
end
- def order_column
+ def order_column_name
acts_as_nested_set_options[:order_column] || left_column_name
end
@@ -31,24 +31,28 @@ module CollectiveIdea #:nodoc:
Array(acts_as_nested_set_options[:scope])
end
+ def counter_cache_column_name
+ acts_as_nested_set_options[:counter_cache]
+ end
+
def quoted_left_column_name
- ActiveRecord::Base.connection.quote_column_name(left_column_name)
+ model_connection.quote_column_name(left_column_name)
end
def quoted_right_column_name
- ActiveRecord::Base.connection.quote_column_name(right_column_name)
+ model_connection.quote_column_name(right_column_name)
end
def quoted_depth_column_name
- ActiveRecord::Base.connection.quote_column_name(depth_column_name)
+ model_connection.quote_column_name(depth_column_name)
end
def quoted_primary_column_name
- ActiveRecord::Base.connection.quote_column_name(primary_column_name)
+ model_connection.quote_column_name(primary_column_name)
end
def quoted_parent_column_name
- ActiveRecord::Base.connection.quote_column_name(parent_column_name)
+ model_connection.quote_column_name(parent_column_name)
end
def quoted_scope_column_names
@@ -56,7 +60,7 @@ module CollectiveIdea #:nodoc:
end
def quoted_order_column_name
- ActiveRecord::Base.connection.quote_column_name(order_column)
+ model_connection.quote_column_name(order_column_name)
end
def quoted_primary_key_column_full_name
@@ -78,6 +82,10 @@ module CollectiveIdea #:nodoc:
def quoted_parent_column_full_name
"#{quoted_table_name}.#{quoted_parent_column_name}"
end
+
+ def model_connection
+ self.is_a?(Class) ? self.connection : self.class.connection
+ end
end
end
end
diff --git a/lib/awesome_nested_set/helper.rb b/lib/awesome_nested_set/helper.rb
index e05af2d..f41562b 100644
--- a/lib/awesome_nested_set/helper.rb
+++ b/lib/awesome_nested_set/helper.rb
@@ -12,8 +12,8 @@ module CollectiveIdea #:nodoc:
#
# == Params
# * +class_or_item+ - Class name or top level times
- # * +mover+ - The item that is being move, used to exlude impossible moves
- # * +&block+ - a block that will be used to display: { |item| ... item.name }
+ # * +mover+ - The item that is being move, used to exclude impossible moves
+ # * +&block+ - a block that will be used to display: { |item| ... item.name }
#
# == Usage
#
diff --git a/lib/awesome_nested_set/model.rb b/lib/awesome_nested_set/model.rb
index 948ff91..f2b9b37 100644
--- a/lib/awesome_nested_set/model.rb
+++ b/lib/awesome_nested_set/model.rb
@@ -52,7 +52,7 @@ module CollectiveIdea #:nodoc:
# Iterates over tree elements and determines the current level in the tree.
# Only accepts default ordering, odering by an other column than lft
- # does not work. This method is much more efficent than calling level
+ # does not work. This method is much more efficient than calling level
# because it doesn't require any additional database queries.
#
# Example:
@@ -79,9 +79,8 @@ module CollectiveIdea #:nodoc:
end
def nested_set_scope(options = {})
- options = {:order => quoted_order_column_full_name}.merge(options)
-
- where(options[:conditions]).order(options.delete(:order))
+ order = scope_order_from_options(options)
+ where(options[:conditions]).order(order)
end
def primary_key_scope(id)
@@ -95,6 +94,12 @@ module CollectiveIdea #:nodoc:
def roots
nested_set_scope.children_of nil
end
+
+ private
+
+ def scope_order_from_options(options)
+ options.fetch(:order, order_column_name)
+ end
end # end class methods
# Any instance method that returns a collection makes use of Rails 2.1's named_scope (which is bundled for Rails 2.0), so it can be treated as a finder.
@@ -139,13 +144,20 @@ module CollectiveIdea #:nodoc:
# performs finds on the base ActiveRecord class, using the :scope
# declared in the acts_as_nested_set declaration.
def nested_set_scope(options = {})
- if (scopes = Array(acts_as_nested_set_options[:scope])).any?
- options[:conditions] = scopes.inject({}) do |conditions,attr|
- conditions.merge attr => self[attr]
- end
- end
+ add_scope_conditions_to_options(options)
- self.class.base_class.nested_set_scope options
+ self.class.base_class.default_scoped.nested_set_scope options
+ end
+
+ # Separate an other `nested_set_scope` for unscoped model
+ # because normal query still need activerecord `default_scope`
+ # Only activerecord callbacks need unscoped model to handle the nested set records
+ # And class level `nested_set_scope` seems just for query `root` `child` .. etc
+ # I think we don't have to provide unscoped `nested_set_scope` in class level.
+ def nested_set_scope_without_default_scope(options = {})
+ add_scope_conditions_to_options(options)
+
+ self.class.base_class.unscoped.nested_set_scope options
end
def to_text
@@ -156,6 +168,13 @@ module CollectiveIdea #:nodoc:
protected
+ def add_scope_conditions_to_options(options)
+ scopes = scope_column_names
+ return if scopes.empty?
+
+ options[:conditions] = scopes.map { |attr| [attr, self[attr] ] }.to_h
+ end
+
def without_self(scope)
return scope if new_record?
scope.where(["#{self.class.quoted_table_name}.#{self.class.quoted_primary_column_name} != ?", self.primary_id])
@@ -171,8 +190,8 @@ module CollectiveIdea #:nodoc:
end
def right_most_node
- @right_most_node ||= self.class.base_class.unscoped.nested_set_scope(
- :order => "#{quoted_right_column_full_name} desc"
+ @right_most_node ||= nested_set_scope_without_default_scope(
+ :order => {right_column_name => :desc}
).first
end
@@ -189,7 +208,6 @@ module CollectiveIdea #:nodoc:
return unless has_depth_column?
in_tenacious_transaction do
- reload
update_depth(level)
end
end
@@ -221,6 +239,20 @@ module CollectiveIdea #:nodoc:
end
end
+ def update_counter_cache
+ return unless acts_as_nested_set_options[:counter_cache]
+
+ # Decrease the counter for all old parents
+ if old_parent = self.parent
+ old_parent.class.decrement_counter(acts_as_nested_set_options[:counter_cache], old_parent)
+ end
+
+ # Increase the counter for all new parents
+ if new_parent = self.reload.parent
+ new_parent.class.increment_counter(acts_as_nested_set_options[:counter_cache], new_parent)
+ end
+ end
+
def set_default_left_and_right
# adds the new node to the right of all existing nodes
self[left_column_name] = right_most_bound + 1
@@ -239,7 +271,7 @@ module CollectiveIdea #:nodoc:
if target.is_a? self.class.base_class
target.reload
elsif position != :root
- nested_set_scope.where(primary_column_name => target).first!
+ nested_set_scope_without_default_scope.where(primary_column_name => target).first!
end
end
end
diff --git a/lib/awesome_nested_set/model/movable.rb b/lib/awesome_nested_set/model/movable.rb
index 1da5daf..4b1bacf 100644
--- a/lib/awesome_nested_set/model/movable.rb
+++ b/lib/awesome_nested_set/model/movable.rb
@@ -46,7 +46,7 @@ module CollectiveIdea #:nodoc:
elsif node.children.count == index
move_to_right_of(node.children.last)
else
- my_position = node.children.index(self)
+ my_position = node.children.to_a.index(self)
if my_position && my_position < index
# e.g. if self is at position 0 and we want to move self to position 1 then self
# needs to move to the *right* of the node at position 1. That's because the node
@@ -105,6 +105,7 @@ module CollectiveIdea #:nodoc:
self.reload_nested_set
Move.new(target, position, self).move
+ update_counter_cache
end
after_move_to(target, position)
end
diff --git a/lib/awesome_nested_set/model/prunable.rb b/lib/awesome_nested_set/model/prunable.rb
index 82d97e4..9e83deb 100644
--- a/lib/awesome_nested_set/model/prunable.rb
+++ b/lib/awesome_nested_set/model/prunable.rb
@@ -10,7 +10,15 @@ module CollectiveIdea #:nodoc:
return if right.nil? || left.nil? || skip_before_destroy
in_tenacious_transaction do
- reload_nested_set
+ # Rescue from +ActiveRecord::RecordNotFound+ error as there may be a case
+ # that an +object+ has already been destroyed by its parent, but objects that are
+ # in memory are not aware about this.
+ begin
+ reload_nested_set
+ rescue ActiveRecord::RecordNotFound
+ self.skip_before_destroy = true
+ return true
+ end
# select the rows in the model that extend past the deletion point and apply a lock
nested_set_scope.right_of(left).select(primary_id).lock(true)
@@ -35,14 +43,17 @@ module CollectiveIdea #:nodoc:
end
elsif acts_as_nested_set_options[:dependent] == :restrict_with_exception
raise ActiveRecord::DeleteRestrictionError.new(:children) unless leaf?
+ return true
elsif acts_as_nested_set_options[:dependent] == :restrict_with_error
unless leaf?
record = self.class.human_attribute_name(:children).downcase
- errors.add(:base, :"restrict_dependent_destroy.many", record: record)
+ errors.add(:base, :"restrict_dependent_destroy.#{Rails::VERSION::MAJOR < 5 ? 'many' : 'has_many'}", record: record)
return false
end
return true
- else
+ elsif acts_as_nested_set_options[:dependent] == :nullify
+ descendants.update_all(parent_column_name => nil)
+ else
descendants.delete_all
end
end
diff --git a/lib/awesome_nested_set/model/rebuildable.rb b/lib/awesome_nested_set/model/rebuildable.rb
index 51c2489..5d6ac4e 100644
--- a/lib/awesome_nested_set/model/rebuildable.rb
+++ b/lib/awesome_nested_set/model/rebuildable.rb
@@ -32,7 +32,11 @@ module CollectiveIdea
end
def order_for_rebuild
- "#{quoted_left_column_full_name}, #{quoted_right_column_full_name}, #{primary_key}"
+ {
+ left_column_name => :asc,
+ right_column_name => :asc,
+ primary_key => :asc
+ }
end
end
diff --git a/lib/awesome_nested_set/model/transactable.rb b/lib/awesome_nested_set/model/transactable.rb
index 1652593..50dfedb 100644
--- a/lib/awesome_nested_set/model/transactable.rb
+++ b/lib/awesome_nested_set/model/transactable.rb
@@ -3,16 +3,23 @@ module CollectiveIdea #:nodoc:
module NestedSet #:nodoc:
module Model
module Transactable
+ class OpenTransactionsIsNotZero < ActiveRecord::StatementInvalid
+ end
+
+ class DeadlockDetected < ActiveRecord::StatementInvalid
+ end
protected
def in_tenacious_transaction(&block)
retry_count = 0
begin
transaction(&block)
+ rescue CollectiveIdea::Acts::NestedSet::Move::ImpossibleMove
+ raise
rescue ActiveRecord::StatementInvalid => error
- raise unless self.class.connection.open_transactions.zero?
+ raise OpenTransactionsIsNotZero.new(error.message) unless self.class.connection.open_transactions.zero?
raise unless error.message =~ /[Dd]eadlock|Lock wait timeout exceeded/
- raise unless retry_count < 10
+ raise DeadlockDetected.new(error.message) unless retry_count < 10
retry_count += 1
logger.info "Deadlock detected on retry #{retry_count}, restarting transaction"
sleep(rand(retry_count)*0.1) # Aloha protocol
diff --git a/lib/awesome_nested_set/model/validatable.rb b/lib/awesome_nested_set/model/validatable.rb
index cb24a71..b93b93c 100644
--- a/lib/awesome_nested_set/model/validatable.rb
+++ b/lib/awesome_nested_set/model/validatable.rb
@@ -20,7 +20,7 @@ module CollectiveIdea
select("#{scope_string}#{column}, COUNT(#{column}) as _count").
group("#{scope_string}#{column}", quoted_primary_key_column_full_name).
having("COUNT(#{column}) > 1").
- order(quoted_primary_key_column_full_name).
+ order(primary_column_name => :asc).
first.nil?
end
end
@@ -41,8 +41,10 @@ module CollectiveIdea
end
def each_root_valid?(roots_to_validate)
+ left_column = acts_as_nested_set_options[:left_column]
+ reordered_roots = roots_reordered_by_column(roots_to_validate, left_column)
left = right = 0
- roots_to_validate.all? do |root|
+ reordered_roots.all? do |root|
(root.left > left && root.right > right).tap do
left = root.left
right = root.right
@@ -57,12 +59,21 @@ module CollectiveIdea
}
end
+ def roots_reordered_by_column(roots_to_reorder, column)
+ if roots_to_reorder.respond_to?(:reorder) # ActiveRecord's relation
+ roots_to_reorder.reorder(column)
+ elsif roots_to_reorder.respond_to?(:sort) # Array
+ roots_to_reorder.sort { |a, b| a.send(column) <=> b.send(column) }
+ else
+ roots_to_reorder
+ end
+ end
+
def scope_string
Array(acts_as_nested_set_options[:scope]).map do |c|
connection.quote_column_name(c)
end.push(nil).join(", ")
end
-
end
end
end
diff --git a/lib/awesome_nested_set/move.rb b/lib/awesome_nested_set/move.rb
index 510b10d..01d783b 100644
--- a/lib/awesome_nested_set/move.rb
+++ b/lib/awesome_nested_set/move.rb
@@ -24,7 +24,7 @@ module CollectiveIdea #:nodoc:
lock_nodes_between! a, d
- nested_set_scope.where(where_statement(a, d)).update_all(
+ nested_set_scope_without_default_scope.where(where_statement(a, d)).update_all(
conditions(a, b, c, d)
)
end
@@ -33,7 +33,7 @@ module CollectiveIdea #:nodoc:
delegate :left, :right, :left_column_name, :right_column_name,
:quoted_left_column_name, :quoted_right_column_name,
- :quoted_parent_column_name, :parent_column_name, :nested_set_scope,
+ :quoted_parent_column_name, :parent_column_name, :nested_set_scope_without_default_scope,
:primary_column_name, :quoted_primary_column_name, :primary_id,
:to => :instance
@@ -41,9 +41,21 @@ module CollectiveIdea #:nodoc:
delegate :base_class, :to => :instance_class, :prefix => :instance
def where_statement(left_bound, right_bound)
- instance_arel_table[left_column_name].in(left_bound..right_bound).
+ instance_arel_table[left_column_name].between(left_bound..right_bound).
+ or(instance_arel_table[right_column_name].between(left_bound..right_bound))
+ end
+
+ # Before Arel 6, there was 'in' method, which was replaced
+ # with 'between' in Arel 6 and now gives deprecation warnings
+ # in verbose mode. This is patch to support rails 4.0 (Arel 4)
+ # and 4.1 (Arel 5).
+ module LegacyWhereStatementExt
+ def where_statement(left_bound, right_bound)
+ instance_arel_table[left_column_name].in(left_bound..right_bound).
or(instance_arel_table[right_column_name].in(left_bound..right_bound))
+ end
end
+ prepend LegacyWhereStatementExt unless Arel::Predications.method_defined?(:between)
def conditions(a, b, c, d)
_conditions = case_condition_for_direction(:quoted_left_column_name) +
@@ -84,8 +96,10 @@ module CollectiveIdea #:nodoc:
def lock_nodes_between!(left_bound, right_bound)
# select the rows in the model between a and d, and apply a lock
- instance_base_class.right_of(left_bound).left_of_right_side(right_bound).
- select(primary_column_name).lock(true)
+ instance_base_class.default_scoped.nested_set_scope.
+ right_of(left_bound).left_of_right_side(right_bound).
+ select(primary_column_name).
+ lock(true)
end
def root
@@ -110,9 +124,12 @@ module CollectiveIdea #:nodoc:
[bound, other_bound]
end
+ class ImpossibleMove < ActiveRecord::StatementInvalid
+ end
+
def prevent_impossible_move
if !root && !instance.move_possible?(target)
- raise ActiveRecord::ActiveRecordError, "Impossible move, target node cannot be inside moved tree."
+ raise ImpossibleMove, "Impossible move, target node cannot be inside moved tree."
end
end
@@ -121,7 +138,7 @@ module CollectiveIdea #:nodoc:
when :child then right(target)
when :left then left(target)
when :right then right(target) + 1
- when :root then nested_set_scope.pluck(right_column_name).max + 1
+ when :root then nested_set_scope_without_default_scope.pluck(right_column_name).max + 1
else raise ActiveRecord::ActiveRecordError, "Position should be :child, :left, :right or :root ('#{position}' received)."
end
end
diff --git a/lib/awesome_nested_set/set_validator.rb b/lib/awesome_nested_set/set_validator.rb
index 1c90d50..a3ef61c 100644
--- a/lib/awesome_nested_set/set_validator.rb
+++ b/lib/awesome_nested_set/set_validator.rb
@@ -29,7 +29,7 @@ module CollectiveIdea #:nodoc:
def join_scope
join_arel = arel_table.join(parent, Arel::Nodes::OuterJoin).on(parent[primary_column_name].eq(arel_table[parent_column_name]))
- self.scope = scope.joins(join_arel.join_sql)
+ self.scope = scope.joins(join_arel.join_sources)
end
def filter_scope
diff --git a/lib/awesome_nested_set/tree.rb b/lib/awesome_nested_set/tree.rb
index 4d8d1ac..c17d1df 100644
--- a/lib/awesome_nested_set/tree.rb
+++ b/lib/awesome_nested_set/tree.rb
@@ -6,7 +6,7 @@ module CollectiveIdea #:nodoc:
attr_accessor :indices
delegate :left_column_name, :right_column_name, :quoted_parent_column_full_name,
- :order_for_rebuild, :scope_for_rebuild,
+ :order_for_rebuild, :scope_for_rebuild, :counter_cache_column_name,
:to => :model
def initialize(model, validate_nodes)
@@ -23,6 +23,7 @@ module CollectiveIdea #:nodoc:
# setup index for this scope
indices[scope_for_rebuild.call(root_node)] ||= 0
set_left_and_rights(root_node)
+ reset_counter_cache(root_node)
end
end
@@ -57,6 +58,15 @@ module CollectiveIdea #:nodoc:
def set_right!(node)
node[right_column_name] = increment_indice!(node)
end
+
+ def reset_counter_cache(node)
+ return unless counter_cache_column_name
+ node.class.reset_counters(node.id, :children)
+
+ node.children.each do |child|
+ reset_counter_cache(child)
+ end
+ end
end
end
end
diff --git a/lib/awesome_nested_set/version.rb b/lib/awesome_nested_set/version.rb
index 0e1e1ab..7b15880 100644
--- a/lib/awesome_nested_set/version.rb
+++ b/lib/awesome_nested_set/version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
module AwesomeNestedSet
- VERSION = '3.0.0' unless defined?(::AwesomeNestedSet::VERSION)
+ VERSION = '3.5.0' unless defined?(::AwesomeNestedSet::VERSION)
end
diff --git a/metadata.gz.sig b/metadata.gz.sig
new file mode 100644
index 0000000..210ef15
--- /dev/null
+++ b/metadata.gz.sig
@@ -0,0 +1,2 @@
+�7��@������9�#�u���5�NK��y'5/9|���8�Uj�)$֦(�w�qZ
벐;�MF��/��dNe�@���8:y�V����TV�������+��I���e��Ǵu#N;�k݂�h�r3K�%s��Ɩ��Y:IP�֭}��r��G��* �F�ТP=\����-�[&�(�A��&��H����!^\�2 �G���'�,a @�9����e*k%�A�zO]p�u���5�Z��d��3�Uؤ�~�orŰ>�/*�/
+�����n�}�I�h�0�ދD ��|_����⯕1�$Z�4y��S�:\衋Ui��磡/��3��yF��ͣ�Ӄ,z5�-و��R�0���ɀ��=n��c
\ No newline at end of file
diff --git a/metadata.yml b/metadata.yml
deleted file mode 100644
index dc486e6..0000000
--- a/metadata.yml
+++ /dev/null
@@ -1,145 +0,0 @@
---- !ruby/object:Gem::Specification
-name: awesome_nested_set
-version: !ruby/object:Gem::Version
- version: 3.0.0
-platform: ruby
-authors:
-- Brandon Keepers
-- Daniel Morrison
-- Philip Arndt
-autorequire:
-bindir: bin
-cert_chain: []
-date: 2014-07-29 00:00:00.000000000 Z
-dependencies:
-- !ruby/object:Gem::Dependency
- name: activerecord
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 4.0.0
- - - "<"
- - !ruby/object:Gem::Version
- version: '5'
- type: :runtime
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 4.0.0
- - - "<"
- - !ruby/object:Gem::Version
- version: '5'
-- !ruby/object:Gem::Dependency
- name: rspec-rails
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '2.12'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '2.12'
-- !ruby/object:Gem::Dependency
- name: rake
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '10'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - "~>"
- - !ruby/object:Gem::Version
- version: '10'
-- !ruby/object:Gem::Dependency
- name: combustion
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 0.3.3
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: 0.3.3
-- !ruby/object:Gem::Dependency
- name: database_cleaner
- requirement: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
- type: :development
- prerelease: false
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-description: An awesome nested set implementation for Active Record
-email: info@collectiveidea.com
-executables: []
-extensions: []
-extra_rdoc_files:
-- README.md
-files:
-- CHANGELOG
-- MIT-LICENSE
-- README.md
-- lib/awesome_nested_set.rb
-- lib/awesome_nested_set/awesome_nested_set.rb
-- lib/awesome_nested_set/columns.rb
-- lib/awesome_nested_set/helper.rb
-- lib/awesome_nested_set/iterator.rb
-- lib/awesome_nested_set/model.rb
-- lib/awesome_nested_set/model/movable.rb
-- lib/awesome_nested_set/model/prunable.rb
-- lib/awesome_nested_set/model/rebuildable.rb
-- lib/awesome_nested_set/model/relatable.rb
-- lib/awesome_nested_set/model/transactable.rb
-- lib/awesome_nested_set/model/validatable.rb
-- lib/awesome_nested_set/move.rb
-- lib/awesome_nested_set/set_validator.rb
-- lib/awesome_nested_set/tree.rb
-- lib/awesome_nested_set/version.rb
-homepage: http://github.com/collectiveidea/awesome_nested_set
-licenses:
-- MIT
-metadata: {}
-post_install_message:
-rdoc_options:
-- "--main"
-- README.md
-- "--inline-source"
-- "--line-numbers"
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: '0'
-requirements: []
-rubyforge_project:
-rubygems_version: 2.2.2
-signing_key:
-specification_version: 4
-summary: An awesome nested set implementation for Active Record
-test_files: []