awesome_nested_set 3.4.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5145938ca7a83f2c7f17b21792d96b43fc7c3e7ad90827af1e54bfc69b67d455
4
- data.tar.gz: a7c20bb47b946a37e4946ca73577f292679e85624aeb03f75762be7b1e3bc3d7
3
+ metadata.gz: 2c26151d6850942daadf3035ba6cbb20399efbe348ae4522cf897bb319e6f0de
4
+ data.tar.gz: 667d9b0cbd91b90b7b7e8075481ba400c4ecbbd344b204908b2301d2daf690d7
5
5
  SHA512:
6
- metadata.gz: b5af92810fd9120cbc84f7ea9f70b444a9331c4ac532e80b03a7c88a506f63a72e80d84ee0b536dfa8f2691c3351d922d55812149188670d45c3945c91a8a651
7
- data.tar.gz: 9abe2f9c68010fe4f8105949afc7ecb9941d0897d89bdc0e994920f7a4dec41b2ee1e372e52bc947cbce8395eedec18546d34ce873ba2e9694a53e4b6ab7ea95
6
+ metadata.gz: 38de65793aacc7b68c542b16018a36bcfa9d65af9158d4126bc4ff25c0759531f8b9af605b2bf31894097935be97c15c6eee7ae72616ab56c6388844138558a3
7
+ data.tar.gz: 319065889f794e1eec94cb8b1e0113dce515da6430401a20910479e1dd763bce238a31ae36cd957f690564bd42458877367b2dd45c3dbe2c2689c2ae550187df
data/CHANGELOG CHANGED
@@ -1,11 +1,19 @@
1
1
  Unreleased version
2
2
 
3
- * [Compare to 3.4.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.4.0...master)
3
+ 3.6.0
4
+ * Support Rails 7.1 [Harshal Bhakta](https://github.com/harshalbhakta)
5
+ * Improve ImpossibleMove error message [AlejandroFernandesAntunes](https://github.com/AlejandroFernandesAntunes)
6
+
7
+ 3.5.0
8
+ * Support Rails 7.0.0 [Peter Berkenbosch](https://github.com/peterberkenbosch) and [Andrew Hampton](https://github.com/andrewhampton)
9
+ * Make `order_column` option more flexible by removing explicit `=> :asc` [Regis Millet](https://github.com/Kulgar)
10
+ * Updated README to use latest migration syntax [Justin MacCarthy](https://github.com/macarthy)
11
+ * [Compare to 3.4.0](https://github.com/collectiveidea/awesome_nested_set/compare/v3.4.0...v3.5.0)
4
12
 
5
13
  3.4.0
6
14
  * Keep current scope when calling `roots` [Petrik de Heus](https://github.com/p8)
7
15
  * STI record now can update counter cache correctly [Issei Murasawa](http://github.com/issei-m)
8
- * [Compare to 3.3.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.1...master)
16
+ * [Compare to 3.3.1](https://github.com/collectiveidea/awesome_nested_set/compare/v3.3.1...v3.4.0)
9
17
 
10
18
  3.3.1
11
19
  * Add belongs_to :polymorphic key option only when used [Filippo Liverani](https://github.com/filippoliverani)
data/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Awesome Nested Set
2
2
 
3
- [![Build Status](https://travis-ci.org/collectiveidea/awesome_nested_set.svg?branch=master)](https://travis-ci.org/collectiveidea/awesome_nested_set) [![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)
3
+ [![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)
4
4
 
5
5
 
6
6
  Awesome Nested Set is an implementation of the nested set pattern for ActiveRecord models.
7
7
  It is a replacement for acts_as_nested_set and BetterNestedSet, but more awesome.
8
8
 
9
- Version 3.2 supports Rails 6, 3.1 supports Rails 5 & 4. Version 2 supports Rails 3.
9
+ Older versions: Version 3.2 supports Rails 6, 3.1 supports Rails 5 & 4. Version 2 supports Rails 3.
10
10
  Gem versions prior to 2.0 support Rails 2.
11
11
 
12
12
  ## What makes this so awesome?
@@ -32,22 +32,19 @@ function properly.
32
32
 
33
33
  ```ruby
34
34
  class CreateCategories < ActiveRecord::Migration
35
- def self.up
35
+ def change
36
36
  create_table :categories do |t|
37
37
  t.string :name
38
- t.integer :parent_id, :null => true, :index => true
39
- t.integer :lft, :null => false, :index => true
40
- t.integer :rgt, :null => false, :index => true
38
+ t.integer :parent_id, null: true, index: true
39
+ t.integer :lft, null: false, index: true
40
+ t.integer :rgt, null: false, index: true
41
41
 
42
42
  # optional fields
43
- t.integer :depth, :null => false, :default => 0
44
- t.integer :children_count, :null => false, :default => 0
43
+ t.integer :depth, null: false, default: 0
44
+ t.integer :children_count, null: false, default: 0
45
+ t.timestamps
45
46
  end
46
47
  end
47
-
48
- def self.down
49
- drop_table :categories
50
- end
51
48
  end
52
49
  ```
53
50
 
@@ -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(order_column_name => :asc) },
90
+ has_many :children, -> { order(order_column_name) },
91
91
  **has_many_children_options
92
92
  end
93
93
 
@@ -12,8 +12,8 @@ module CollectiveIdea #:nodoc:
12
12
  #
13
13
  # == Params
14
14
  # * +class_or_item+ - Class name or top level times
15
- # * +mover+ - The item that is being move, used to exlude impossible moves
16
- # * +&block+ - a block that will be used to display: { |item| ... item.name }
15
+ # * +mover+ - The item that is being move, used to exclude impossible moves
16
+ # * +&block+ - a block that will be used to display: { |item| ... item.name }
17
17
  #
18
18
  # == Usage
19
19
  #
@@ -47,8 +47,13 @@ module CollectiveIdea #:nodoc:
47
47
  elsif acts_as_nested_set_options[:dependent] == :restrict_with_error
48
48
  unless leaf?
49
49
  record = self.class.human_attribute_name(:children).downcase
50
- errors.add(:base, :"restrict_dependent_destroy.#{Rails::VERSION::MAJOR < 5 ? 'many' : 'has_many'}", record: record)
51
- return false
50
+ if Rails::VERSION::MAJOR < 5
51
+ errors.add(:base, :"restrict_dependent_destroy.many", record: record)
52
+ return false
53
+ else
54
+ errors.add(:base, :"restrict_dependent_destroy.has_many", record: record)
55
+ throw :abort
56
+ end
52
57
  end
53
58
  return true
54
59
  elsif acts_as_nested_set_options[:dependent] == :nullify
@@ -98,7 +98,7 @@ module CollectiveIdea #:nodoc:
98
98
  private
99
99
 
100
100
  def scope_order_from_options(options)
101
- options.fetch(:order, { order_column_name => :asc })
101
+ options.fetch(:order, order_column_name)
102
102
  end
103
103
  end # end class methods
104
104
 
@@ -129,7 +129,9 @@ module CollectiveIdea #:nodoc:
129
129
 
130
130
  def prevent_impossible_move
131
131
  if !root && !instance.move_possible?(target)
132
- raise ImpossibleMove, "Impossible move, target node cannot be inside moved tree."
132
+ error_msg = "Impossible move, target node (#{target.class.name},ID: #{target.id})
133
+ cannot be inside moved tree (#{instance.class.name},ID: #{instance.id})."
134
+ raise ImpossibleMove, error_msg
133
135
  end
134
136
  end
135
137
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AwesomeNestedSet
4
- VERSION = '3.4.0' unless defined?(::AwesomeNestedSet::VERSION)
4
+ VERSION = '3.6.0' unless defined?(::AwesomeNestedSet::VERSION)
5
5
  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.4.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Keepers
@@ -9,34 +9,8 @@ authors:
9
9
  - Philip Arndt
10
10
  autorequire:
11
11
  bindir: bin
12
- cert_chain:
13
- - |
14
- -----BEGIN CERTIFICATE-----
15
- MIIEMjCCApqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhnZW1z
16
- L0RDPXAvREM9YXJuZHQvREM9aW8wHhcNMjAwNTEwMjIxOTQ2WhcNMjEwNTEwMjIx
17
- OTQ2WjAjMSEwHwYDVQQDDBhnZW1zL0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JKSoDHRzVTmNB7sX8rs8P2kvYkpIUXPHyls3mWBWjBWbdEYWESZrxI2x
34
- dS7jY3AnfqhvsWra2pSREb2IDqPnJrHVOejnEI/zuuufUxLwDx3AC6SMdsyWkZ7V
35
- 9OmLt2rg75Sct6h2220lO5ySqYtqAXuOMBDGv5L0zLalx1g8LACA7uILTKVWh8B8
36
- Hsej0MQ3drCB1eA4c9OXdCUQJnY2aLTq3uNvTbZvoTgWK55eq3KLBJ4zzoKZ4tBX
37
- /HIFI/fEwYlI1Ji3oikUrHkc4rWgaQ==
38
- -----END CERTIFICATE-----
39
- date: 2021-02-22 00:00:00.000000000 Z
12
+ cert_chain: []
13
+ date: 2023-10-05 00:00:00.000000000 Z
40
14
  dependencies:
41
15
  - !ruby/object:Gem::Dependency
42
16
  name: activerecord
@@ -47,7 +21,7 @@ dependencies:
47
21
  version: 4.0.0
48
22
  - - "<"
49
23
  - !ruby/object:Gem::Version
50
- version: '7.0'
24
+ version: '7.2'
51
25
  type: :runtime
52
26
  prerelease: false
53
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +31,7 @@ dependencies:
57
31
  version: 4.0.0
58
32
  - - "<"
59
33
  - !ruby/object:Gem::Version
60
- version: '7.0'
34
+ version: '7.2'
61
35
  - !ruby/object:Gem::Dependency
62
36
  name: appraisal
63
37
  requirement: !ruby/object:Gem::Requirement
@@ -72,26 +46,6 @@ dependencies:
72
46
  - - ">="
73
47
  - !ruby/object:Gem::Version
74
48
  version: '0'
75
- - !ruby/object:Gem::Dependency
76
- name: combustion
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: 0.5.2
82
- - - "<"
83
- - !ruby/object:Gem::Version
84
- version: 0.5.5
85
- type: :development
86
- prerelease: false
87
- version_requirements: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: 0.5.2
92
- - - "<"
93
- - !ruby/object:Gem::Version
94
- version: 0.5.5
95
49
  - !ruby/object:Gem::Dependency
96
50
  name: database_cleaner
97
51
  requirement: !ruby/object:Gem::Requirement
@@ -140,14 +94,14 @@ dependencies:
140
94
  requirements:
141
95
  - - "~>"
142
96
  - !ruby/object:Gem::Version
143
- version: '10'
97
+ version: '13'
144
98
  type: :development
145
99
  prerelease: false
146
100
  version_requirements: !ruby/object:Gem::Requirement
147
101
  requirements:
148
102
  - - "~>"
149
103
  - !ruby/object:Gem::Version
150
- version: '10'
104
+ version: '13'
151
105
  - !ruby/object:Gem::Dependency
152
106
  name: rspec-rails
153
107
  requirement: !ruby/object:Gem::Requirement
@@ -188,7 +142,7 @@ files:
188
142
  - lib/awesome_nested_set/set_validator.rb
189
143
  - lib/awesome_nested_set/tree.rb
190
144
  - lib/awesome_nested_set/version.rb
191
- homepage: http://github.com/collectiveidea/awesome_nested_set
145
+ homepage: https://github.com/collectiveidea/awesome_nested_set
192
146
  licenses:
193
147
  - MIT
194
148
  metadata: {}
@@ -211,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
165
  - !ruby/object:Gem::Version
212
166
  version: '0'
213
167
  requirements: []
214
- rubygems_version: 3.1.4
168
+ rubygems_version: 3.4.13
215
169
  signing_key:
216
170
  specification_version: 4
217
171
  summary: An awesome nested set implementation for Active Record
checksums.yaml.gz.sig DELETED
Binary file
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
@@ -1,4 +0,0 @@
1
- ~� �y���Z<v��R��C;�\����uy���;�kh����f�3����\l�S^�����=��Xu!�`�(9ʈ,&��q���nM1�H����wu3C��D��U&���,�>f�/�o�a�g
2
-
3
- C�
4
- L+�!��l+FAy��o�V�R���O}b�ST��mx�|8;Jl�n����9�L!��\� ���o9{�� �L�F����z�xg�s��=M�3��_�`9+8X$~F� zN z1����