awesome_nested_set 3.1.3 → 3.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 158eb30c327a8fa16c990178bf3a8b27b92df7f3
4
- data.tar.gz: 6dc79c6c67d4d4a87615d1627a066aef746612e2
3
+ metadata.gz: 886dba55e5efcba602756917fdd82ae57c3e6942
4
+ data.tar.gz: 0f17ad95fef44901498f7b21b2767b0b0e0d0259
5
5
  SHA512:
6
- metadata.gz: c6816a36e5be6882f655779572f8174fce473e82c8b2b47a23402c72522132a061a8b3a29ad3f2d980b82b87f2536c69042ab1aa130a81f3618138ec2b2ea7ce
7
- data.tar.gz: 35c3cf5f2cb9583c7d7c605a2209d5f3a8e4ed6538f914ee55da323f4d9f9eadb27494dfc6b77e67788d4eba49ab0aa0e7741731bb9341a83e43b759a233c817
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 support [John Hawthorn](https://github.com/jhawthorn)
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 acts provides Nested Set functionality. Nested Set is a smart way to implement
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 replacment from one
19
- # by another easier.
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(quoted_order_column_full_name) },
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 => quoted_order_column_full_name}.merge(options)
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 => "#{quoted_right_column_full_name} desc"
186
+ :order => {right_column_name => :desc}
187
187
  ).first
188
188
  end
189
189
 
@@ -52,7 +52,7 @@ module CollectiveIdea #:nodoc:
52
52
  end
53
53
  return true
54
54
  elsif acts_as_nested_set_options[:dependent] == :nullify
55
- descendants.update_all(parent_id: nil)
55
+ descendants.update_all(parent_column_name => nil)
56
56
  else
57
57
  descendants.delete_all
58
58
  end
@@ -32,7 +32,11 @@ module CollectiveIdea
32
32
  end
33
33
 
34
34
  def order_for_rebuild
35
- "#{quoted_left_column_full_name}, #{quoted_right_column_full_name}, #{primary_key}"
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(quoted_primary_key_column_full_name).
23
+ order(primary_column_name => :asc).
24
24
  first.nil?
25
25
  end
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module AwesomeNestedSet
2
- VERSION = '3.1.3' unless defined?(::AwesomeNestedSet::VERSION)
2
+ VERSION = '3.1.4' unless defined?(::AwesomeNestedSet::VERSION)
3
3
  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.3
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: 2017-05-05 00:00:00.000000000 Z
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.2'
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.2'
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.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