acts_as_list 1.0.2 → 1.0.3
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 +4 -4
- data/.travis.yml +3 -0
- data/Appraisals +12 -3
- data/CHANGELOG.md +6 -0
- data/Gemfile +1 -1
- data/gemfiles/rails_5_1.gemfile +1 -1
- data/gemfiles/rails_5_2.gemfile +1 -1
- data/gemfiles/rails_6_1.gemfile +31 -0
- data/lib/acts_as_list/active_record/acts/list.rb +1 -1
- data/lib/acts_as_list/active_record/acts/scope_method_definer.rb +1 -0
- data/lib/acts_as_list/version.rb +1 -1
- data/test/helper.rb +16 -0
- data/test/shared_list.rb +6 -0
- data/test/test_list.rb +18 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfe49b92bf1cb2d1fe15c55eacacf23c5355368a193b0d5fe5c3d279280fc79b
|
4
|
+
data.tar.gz: 71a11063d260b88cbbe59b4dd66c9475d4aa8fc7bdead764af44bd372ab3d753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8559b0028cb19c2872d6a16bc9b78bcf720a3d1571a9ba8373b4c7a0e1594dc1d0325afa45b7225666291c77183eaf42dc32eba64614006ed341586adbdbb1bf
|
7
|
+
data.tar.gz: 90173182d8b93c012b70c64b0981fc5ff3599342c61c454e61455ebce03d23100b9af1432eff979bd18325f2f3873e6e4997f8b2fb31308be752494fdd0b358b
|
data/.travis.yml
CHANGED
@@ -23,7 +23,10 @@ gemfile:
|
|
23
23
|
- gemfiles/rails_5_1.gemfile
|
24
24
|
- gemfiles/rails_5_2.gemfile
|
25
25
|
- gemfiles/rails_6_0.gemfile
|
26
|
+
- gemfiles/rails_6_1.gemfile
|
26
27
|
matrix:
|
27
28
|
exclude:
|
28
29
|
- rvm: 2.4.7
|
29
30
|
gemfile: gemfiles/rails_6_0.gemfile
|
31
|
+
- rvm: 2.4.7
|
32
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
data/Appraisals
CHANGED
@@ -8,10 +8,18 @@ appraise "rails-4-2" do
|
|
8
8
|
group :test do
|
9
9
|
gem "test_after_commit", "~> 0.4.2"
|
10
10
|
end
|
11
|
+
group :sqlite do
|
12
|
+
gem "sqlite3", "~> 1.3.13"
|
13
|
+
end
|
14
|
+
|
11
15
|
gem "activerecord", "~> 4.2.0"
|
12
16
|
end
|
13
17
|
|
14
18
|
appraise "rails-5-0" do
|
19
|
+
group :sqlite do
|
20
|
+
gem "sqlite3", "~> 1.3.13"
|
21
|
+
end
|
22
|
+
|
15
23
|
gem "activerecord", "~> 5.0.0"
|
16
24
|
end
|
17
25
|
|
@@ -24,8 +32,9 @@ appraise "rails-5-2" do
|
|
24
32
|
end
|
25
33
|
|
26
34
|
appraise "rails-6-0" do
|
27
|
-
group :sqlite do
|
28
|
-
gem "sqlite3", "~> 1.4"
|
29
|
-
end
|
30
35
|
gem "activerecord", "~> 6.0.0"
|
31
36
|
end
|
37
|
+
|
38
|
+
appraise "rails-6-1" do
|
39
|
+
gem "activerecord", "6.1.0.rc1"
|
40
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## Unreleased
|
8
8
|
|
9
|
+
## v1.0.3 - 2020-12-24
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- Silence deprecation warnings in Rails 6 [\#384](https://github.com/brendon/acts_as_list/pull/384) ([h-lame])
|
13
|
+
- Add explicit requirement of ActiveSupport::Inflector [\#387](https://github.com/brendon/acts_as_list/pull/387) ([rdvdijk])
|
14
|
+
|
9
15
|
## v1.0.2 - 2020-09-14
|
10
16
|
|
11
17
|
### Fixed
|
data/Gemfile
CHANGED
data/gemfiles/rails_5_1.gemfile
CHANGED
data/gemfiles/rails_5_2.gemfile
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "http://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "appraisal"
|
7
|
+
gem "activerecord", "6.1.0.rc1"
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem "github_changelog_generator", "1.9.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
group :test do
|
14
|
+
gem "minitest", "~> 5.0"
|
15
|
+
gem "timecop"
|
16
|
+
gem "mocha"
|
17
|
+
end
|
18
|
+
|
19
|
+
group :sqlite do
|
20
|
+
gem "sqlite3", "~> 1.4"
|
21
|
+
end
|
22
|
+
|
23
|
+
group :postgresql do
|
24
|
+
gem "pg", "~> 1.1.4"
|
25
|
+
end
|
26
|
+
|
27
|
+
group :mysql do
|
28
|
+
gem "mysql2", "~> 0.5.0"
|
29
|
+
end
|
30
|
+
|
31
|
+
gemspec path: "../"
|
@@ -226,7 +226,7 @@ module ActiveRecord
|
|
226
226
|
end
|
227
227
|
|
228
228
|
def acts_as_list_list
|
229
|
-
acts_as_list_class.unscope(:select, :where).where(scope_condition)
|
229
|
+
acts_as_list_class.default_scoped.unscope(:select, :where).where(scope_condition)
|
230
230
|
end
|
231
231
|
|
232
232
|
# Poorly named methods. They will insert the item at the desired position if the position
|
data/lib/acts_as_list/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -51,3 +51,19 @@ def assert_equal_or_nil(a, b)
|
|
51
51
|
assert_equal a, b
|
52
52
|
end
|
53
53
|
end
|
54
|
+
|
55
|
+
def assert_no_deprecation_warning_raised_by(failure_message = 'ActiveRecord deprecation warning raised when we didn\'t expect it', pass_message = 'No ActiveRecord deprecation raised')
|
56
|
+
original_behavior = ActiveSupport::Deprecation.behavior
|
57
|
+
ActiveSupport::Deprecation.behavior = :raise
|
58
|
+
begin
|
59
|
+
yield
|
60
|
+
rescue ActiveSupport::DeprecationException => e
|
61
|
+
flunk "#{failure_message}: #{e}"
|
62
|
+
rescue
|
63
|
+
raise
|
64
|
+
else
|
65
|
+
pass pass_message
|
66
|
+
end
|
67
|
+
ensure
|
68
|
+
ActiveSupport::Deprecation.behavior = original_behavior
|
69
|
+
end
|
data/test/shared_list.rb
CHANGED
@@ -314,5 +314,11 @@ module Shared
|
|
314
314
|
new.insert_at!(1)
|
315
315
|
end
|
316
316
|
end
|
317
|
+
|
318
|
+
def test_find_or_create_doesnt_raise_deprecation_warning
|
319
|
+
assert_no_deprecation_warning_raised_by('ActiveRecord deprecation warning raised when using `find_or_create_by` when we didn\'t expect it') do
|
320
|
+
ListMixin.where(parent_id: 5).find_or_create_by(pos: 5)
|
321
|
+
end
|
322
|
+
end
|
317
323
|
end
|
318
324
|
end
|
data/test/test_list.rb
CHANGED
@@ -419,6 +419,12 @@ class DefaultScopedTest < ActsAsListTestCase
|
|
419
419
|
assert_equal_or_nil $default_position, new_noup.pos
|
420
420
|
end
|
421
421
|
|
422
|
+
def test_find_or_create_doesnt_raise_deprecation_warning
|
423
|
+
assert_no_deprecation_warning_raised_by('ActiveRecord deprecation warning raised when using `find_or_create_by` when we didn\'t expect it') do
|
424
|
+
DefaultScopedMixin.find_or_create_by(pos: 5)
|
425
|
+
end
|
426
|
+
end
|
427
|
+
|
422
428
|
def test_update_position
|
423
429
|
assert_equal [1, 2, 3, 4], DefaultScopedMixin.all.map(&:id)
|
424
430
|
DefaultScopedMixin.where(id: 2).first.set_list_position(4)
|
@@ -523,6 +529,12 @@ class DefaultScopedWhereTest < ActsAsListTestCase
|
|
523
529
|
assert_equal_or_nil $default_position, new_noup.pos
|
524
530
|
end
|
525
531
|
|
532
|
+
def test_find_or_create_doesnt_raise_deprecation_warning
|
533
|
+
assert_no_deprecation_warning_raised_by('ActiveRecord deprecation warning raised when using `find_or_create_by` when we didn\'t expect it') do
|
534
|
+
DefaultScopedWhereMixin.find_or_create_by(pos: 5)
|
535
|
+
end
|
536
|
+
end
|
537
|
+
|
526
538
|
def test_update_position
|
527
539
|
assert_equal [1, 2, 3, 4], DefaultScopedWhereMixin.for_active_false_tests.map(&:id)
|
528
540
|
DefaultScopedWhereMixin.for_active_false_tests.where(id: 2).first.set_list_position(4)
|
@@ -643,6 +655,12 @@ class MultipleListsTest < ActsAsListTestCase
|
|
643
655
|
assert_equal [1, 2, 3], ListMixin.where(:parent_id => 1).order('pos').map(&:pos)
|
644
656
|
assert_equal [1, 2, 3, 4, 5], ListMixin.where(:parent_id => 2).order('pos').map(&:pos)
|
645
657
|
end
|
658
|
+
|
659
|
+
def test_find_or_create_doesnt_raise_deprecation_warning
|
660
|
+
assert_no_deprecation_warning_raised_by('ActiveRecord deprecation warning raised when using `find_or_create_by` when we didn\'t expect it') do
|
661
|
+
ListMixin.where(:parent_id => 1).find_or_create_by(pos: 5)
|
662
|
+
end
|
663
|
+
end
|
646
664
|
end
|
647
665
|
|
648
666
|
class EnumArrayScopeListMixinTest < ActsAsListTestCase
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swanand Pagnis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -65,6 +65,7 @@ files:
|
|
65
65
|
- gemfiles/rails_5_1.gemfile
|
66
66
|
- gemfiles/rails_5_2.gemfile
|
67
67
|
- gemfiles/rails_6_0.gemfile
|
68
|
+
- gemfiles/rails_6_1.gemfile
|
68
69
|
- init.rb
|
69
70
|
- lib/acts_as_list.rb
|
70
71
|
- lib/acts_as_list/active_record/acts/active_record.rb
|