awesome_nested_set 3.1.3 → 3.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -1
- data/lib/awesome_nested_set/awesome_nested_set.rb +4 -4
- data/lib/awesome_nested_set/model.rb +2 -2
- data/lib/awesome_nested_set/model/prunable.rb +1 -1
- data/lib/awesome_nested_set/model/rebuildable.rb +5 -1
- data/lib/awesome_nested_set/model/validatable.rb +1 -1
- data/lib/awesome_nested_set/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 886dba55e5efcba602756917fdd82ae57c3e6942
|
4
|
+
data.tar.gz: 0f17ad95fef44901498f7b21b2767b0b0e0d0259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e52c139d7f15f8a9428ec22967c50899e9f31cdcbb301b59cdc322f796b2ce6ad51fa30e28e16cd975c76e73bc48c32e869ba24df06bad0a8e2a6e87b58169f7
|
7
|
+
data.tar.gz: 610280af1b3026696fd3980f7f6bb49d206ad255c770a9be9f0ab3372af455fa62c610cc8de3c68cfb6c8dcbd06431383a8082f8f9449157f668a7c13da8a6a9
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
3.1.4
|
2
|
+
* Add support for Rails 5.2 [John Hawthorn](https://github.com/jhawthorn) and [marocchino](https://github.com/marocchino)
|
3
|
+
|
1
4
|
3.1.3
|
2
|
-
* Add Rails 5.1
|
5
|
+
* Add support for Rails 5.1 [John Hawthorn](https://github.com/jhawthorn)
|
3
6
|
|
4
7
|
3.1.2
|
5
8
|
* Make belongs_to relation optional again [Jan Matusz](https://marahin.pl/)
|
@@ -5,7 +5,7 @@ module CollectiveIdea #:nodoc:
|
|
5
5
|
module Acts #:nodoc:
|
6
6
|
module NestedSet #:nodoc:
|
7
7
|
|
8
|
-
# This
|
8
|
+
# This provides Nested Set functionality. Nested Set is a smart way to implement
|
9
9
|
# an _ordered_ tree, with the added feature that you can select the children and all of their
|
10
10
|
# descendants with a single query. The drawback is that insertion or move need some complex
|
11
11
|
# sql queries. But everything is done here by this module!
|
@@ -15,8 +15,8 @@ module CollectiveIdea #:nodoc:
|
|
15
15
|
#
|
16
16
|
# == API
|
17
17
|
#
|
18
|
-
# Methods names are aligned with acts_as_tree as much as possible to make
|
19
|
-
#
|
18
|
+
# Methods names are aligned with acts_as_tree as much as possible to make transition from one
|
19
|
+
# to another easier.
|
20
20
|
#
|
21
21
|
# item.children.create(:name => "child1")
|
22
22
|
#
|
@@ -87,7 +87,7 @@ module CollectiveIdea #:nodoc:
|
|
87
87
|
) if acts_as_nested_set_options[ar_callback]
|
88
88
|
end
|
89
89
|
|
90
|
-
has_many :children, -> { order(
|
90
|
+
has_many :children, -> { order(order_column => :asc) },
|
91
91
|
has_many_children_options
|
92
92
|
end
|
93
93
|
|
@@ -79,7 +79,7 @@ module CollectiveIdea #:nodoc:
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def nested_set_scope(options = {})
|
82
|
-
options = {:order =>
|
82
|
+
options = {:order => { order_column => :asc }}.merge(options)
|
83
83
|
|
84
84
|
where(options[:conditions]).order(options.delete(:order))
|
85
85
|
end
|
@@ -183,7 +183,7 @@ module CollectiveIdea #:nodoc:
|
|
183
183
|
|
184
184
|
def right_most_node
|
185
185
|
@right_most_node ||= nested_set_scope_without_default_scope(
|
186
|
-
:order =>
|
186
|
+
:order => {right_column_name => :desc}
|
187
187
|
).first
|
188
188
|
end
|
189
189
|
|
@@ -32,7 +32,11 @@ module CollectiveIdea
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def order_for_rebuild
|
35
|
-
|
35
|
+
{
|
36
|
+
left_column_name => :asc,
|
37
|
+
right_column_name => :asc,
|
38
|
+
primary_key => :asc
|
39
|
+
}
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
@@ -20,7 +20,7 @@ module CollectiveIdea
|
|
20
20
|
select("#{scope_string}#{column}, COUNT(#{column}) as _count").
|
21
21
|
group("#{scope_string}#{column}", quoted_primary_key_column_full_name).
|
22
22
|
having("COUNT(#{column}) > 1").
|
23
|
-
order(
|
23
|
+
order(primary_column_name => :asc).
|
24
24
|
first.nil?
|
25
25
|
end
|
26
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awesome_nested_set
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Keepers
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-02-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 4.0.0
|
22
22
|
- - "<"
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version: '5.
|
24
|
+
version: '5.3'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -31,7 +31,7 @@ dependencies:
|
|
31
31
|
version: 4.0.0
|
32
32
|
- - "<"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '5.
|
34
|
+
version: '5.3'
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: appraisal
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
186
|
version: '0'
|
187
187
|
requirements: []
|
188
188
|
rubyforge_project:
|
189
|
-
rubygems_version: 2.6.
|
189
|
+
rubygems_version: 2.6.13
|
190
190
|
signing_key:
|
191
191
|
specification_version: 4
|
192
192
|
summary: An awesome nested set implementation for Active Record
|