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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b697b0a1f7de57449d3b08718d3092b4d3415b482ced1e3f8451255f756d8f9
4
- data.tar.gz: e6450636ddb5a4a581be40b48b85dc540c739f7c04e2dd8a298b4193083d929c
3
+ metadata.gz: cfe49b92bf1cb2d1fe15c55eacacf23c5355368a193b0d5fe5c3d279280fc79b
4
+ data.tar.gz: 71a11063d260b88cbbe59b4dd66c9475d4aa8fc7bdead764af44bd372ab3d753
5
5
  SHA512:
6
- metadata.gz: d5167239a2867ebe360247dd874689be782e71377ca484a6fcbeea400fc35e076bf9137db424fdf311370cc965c41f74e1703ea5f6b5ba3f00cfffb235b5c5e2
7
- data.tar.gz: a19ab76d2c215c735c1d42890a9d322c0cccc95eb594093cf5dd13d4c830a91a02ff7cf74ea2c71072fddfb3f6898415527b28780e70383cd2554a06e171afc0
6
+ metadata.gz: 8559b0028cb19c2872d6a16bc9b78bcf720a3d1571a9ba8373b4c7a0e1594dc1d0325afa45b7225666291c77183eaf42dc32eba64614006ed341586adbdbb1bf
7
+ data.tar.gz: 90173182d8b93c012b70c64b0981fc5ff3599342c61c454e61455ebce03d23100b9af1432eff979bd18325f2f3873e6e4997f8b2fb31308be752494fdd0b358b
@@ -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
@@ -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
@@ -16,7 +16,7 @@ group :test do
16
16
  end
17
17
 
18
18
  group :sqlite do
19
- gem "sqlite3", "~> 1.3.13"
19
+ gem "sqlite3", "~> 1.4"
20
20
  end
21
21
 
22
22
  group :postgresql do
@@ -17,7 +17,7 @@ group :test do
17
17
  end
18
18
 
19
19
  group :sqlite do
20
- gem "sqlite3", "~> 1.3.13"
20
+ gem "sqlite3", "~> 1.4"
21
21
  end
22
22
 
23
23
  group :postgresql do
@@ -17,7 +17,7 @@ group :test do
17
17
  end
18
18
 
19
19
  group :sqlite do
20
- gem "sqlite3", "~> 1.3.13"
20
+ gem "sqlite3", "~> 1.4"
21
21
  end
22
22
 
23
23
  group :postgresql do
@@ -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
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+ require "active_support/inflector"
2
3
 
3
4
  module ActiveRecord::Acts::List::ScopeMethodDefiner #:nodoc:
4
5
  extend ActiveSupport::Inflector
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module Acts
5
5
  module List
6
- VERSION = '1.0.2'
6
+ VERSION = '1.0.3'
7
7
  end
8
8
  end
9
9
  end
@@ -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
@@ -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
@@ -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.2
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-09-13 00:00:00.000000000 Z
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