acts_as_list 0.9.19 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +11 -40
- data/Appraisals +15 -34
- data/CHANGELOG.md +10 -0
- data/Gemfile +6 -5
- data/README.md +80 -4
- data/acts_as_list.gemspec +9 -9
- data/gemfiles/rails_4_2.gemfile +6 -7
- data/gemfiles/rails_5_0.gemfile +4 -6
- data/gemfiles/rails_5_1.gemfile +4 -6
- data/gemfiles/rails_5_2.gemfile +4 -6
- data/gemfiles/rails_6_0.gemfile +31 -0
- data/lib/acts_as_list/active_record/acts/list.rb +43 -48
- data/lib/acts_as_list/active_record/acts/position_column_method_definer.rb +1 -1
- data/lib/acts_as_list/active_record/acts/scope_method_definer.rb +0 -2
- data/lib/acts_as_list/active_record/acts/sequential_updates_method_definer.rb +1 -1
- data/lib/acts_as_list/version.rb +1 -1
- data/test/helper.rb +1 -10
- data/test/shared_list.rb +8 -4
- data/test/shared_list_sub.rb +1 -1
- data/test/test_list.rb +36 -56
- data/test/test_no_update_for_extra_classes.rb +5 -5
- data/test/test_no_update_for_scope_destruction.rb +2 -7
- data/test/test_no_update_for_subclasses.rb +3 -3
- metadata +9 -10
- data/gemfiles/rails_3_2.gemfile +0 -34
- data/gemfiles/rails_4_1.gemfile +0 -34
@@ -56,13 +56,13 @@ class NoUpdateForCollectionClassesTest < NoUpdateForCollectionClassesTestCase
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_update
|
59
|
-
@item_1.
|
59
|
+
@item_1.update position: 2
|
60
60
|
assert_equal 2, @item_1.reload.position
|
61
61
|
assert_equal 1, @item_2.reload.position
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_no_update_for_single_class_instances
|
65
|
-
TodoItem.acts_as_list_no_update { @item_1.
|
65
|
+
TodoItem.acts_as_list_no_update { @item_1.update position: 2 }
|
66
66
|
|
67
67
|
assert_equal 2, @item_1.reload.position
|
68
68
|
assert_equal 2, @item_2.reload.position
|
@@ -124,8 +124,8 @@ class NoUpdateForCollectionClassesTest < NoUpdateForCollectionClassesTestCase
|
|
124
124
|
private
|
125
125
|
|
126
126
|
def update_records!
|
127
|
-
@item_1.
|
128
|
-
@attachment_1.
|
129
|
-
@list_1.
|
127
|
+
@item_1.update position: 2
|
128
|
+
@attachment_1.update position: 2
|
129
|
+
@list_1.update position: 2
|
130
130
|
end
|
131
131
|
end
|
@@ -53,13 +53,8 @@ class NoUpdateForScopeDestructionTestCase < Minitest::Test
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def test_no_update_children_when_parent_destroyed
|
56
|
-
|
57
|
-
|
58
|
-
DestructionTadaItem.any_instance.expects(:decrement_positions_on_lower_items).once
|
59
|
-
else
|
60
|
-
DestructionTodoItem.any_instance.expects(:decrement_positions_on_lower_items).never
|
61
|
-
DestructionTadaItem.any_instance.expects(:decrement_positions_on_lower_items).never
|
62
|
-
end
|
56
|
+
DestructionTodoItem.any_instance.expects(:decrement_positions_on_lower_items).never
|
57
|
+
DestructionTadaItem.any_instance.expects(:decrement_positions_on_lower_items).never
|
63
58
|
assert @list.destroy
|
64
59
|
end
|
65
60
|
|
@@ -35,20 +35,20 @@ class NoUpdateForSubclassesTest < NoUpdateForSubclassesTestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_update
|
38
|
-
@item_1.
|
38
|
+
@item_1.update position: 2
|
39
39
|
assert_equal 2, @item_1.reload.position
|
40
40
|
assert_equal 1, @item_2.reload.position
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_no_update_for_subclass_instances_with_no_update_on_superclass
|
44
|
-
MasterItem.acts_as_list_no_update { @item_1.
|
44
|
+
MasterItem.acts_as_list_no_update { @item_1.update position: 2 }
|
45
45
|
|
46
46
|
assert_equal 2, @item_1.reload.position
|
47
47
|
assert_equal 2, @item_2.reload.position
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_no_update_for_subclass_instances_with_no_update_on_subclass
|
51
|
-
SlaveItem.acts_as_list_no_update { @item_1.
|
51
|
+
SlaveItem.acts_as_list_no_update { @item_1.update position: 2 }
|
52
52
|
|
53
53
|
assert_equal 2, @item_1.reload.position
|
54
54
|
assert_equal 2, @item_2.reload.position
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- David Heinemeier Hansson
|
8
7
|
- Swanand Pagnis
|
9
|
-
-
|
8
|
+
- Brendon Muir
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2019-
|
12
|
+
date: 2019-09-26 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: activerecord
|
@@ -18,14 +17,14 @@ dependencies:
|
|
18
17
|
requirements:
|
19
18
|
- - ">="
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
20
|
+
version: '4.2'
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
25
|
- - ">="
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
27
|
+
version: '4.2'
|
29
28
|
- !ruby/object:Gem::Dependency
|
30
29
|
name: bundler
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,6 +44,7 @@ description: This "acts_as" extension provides the capabilities for sorting and
|
|
45
44
|
"position" column defined as an integer on the mapped database table.
|
46
45
|
email:
|
47
46
|
- swanand.pagnis@gmail.com
|
47
|
+
- brendon@spikeatschool.co.nz
|
48
48
|
executables: []
|
49
49
|
extensions: []
|
50
50
|
extra_rdoc_files: []
|
@@ -59,12 +59,11 @@ files:
|
|
59
59
|
- README.md
|
60
60
|
- Rakefile
|
61
61
|
- acts_as_list.gemspec
|
62
|
-
- gemfiles/rails_3_2.gemfile
|
63
|
-
- gemfiles/rails_4_1.gemfile
|
64
62
|
- gemfiles/rails_4_2.gemfile
|
65
63
|
- gemfiles/rails_5_0.gemfile
|
66
64
|
- gemfiles/rails_5_1.gemfile
|
67
65
|
- gemfiles/rails_5_2.gemfile
|
66
|
+
- gemfiles/rails_6_0.gemfile
|
68
67
|
- init.rb
|
69
68
|
- lib/acts_as_list.rb
|
70
69
|
- lib/acts_as_list/active_record/acts/active_record.rb
|
@@ -109,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
108
|
requirements:
|
110
109
|
- - ">="
|
111
110
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
111
|
+
version: 2.4.7
|
113
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
113
|
requirements:
|
115
114
|
- - ">="
|
@@ -117,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
116
|
version: '0'
|
118
117
|
requirements: []
|
119
118
|
rubyforge_project: acts_as_list
|
120
|
-
rubygems_version: 2.
|
119
|
+
rubygems_version: 2.7.6.2
|
121
120
|
signing_key:
|
122
121
|
specification_version: 4
|
123
122
|
summary: A gem adding sorting, reordering capabilities to an active_record model,
|
data/gemfiles/rails_3_2.gemfile
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "http://rubygems.org"
|
4
|
-
|
5
|
-
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
|
-
gem "rake", "~> 12.2.0", platforms: [:ruby_19]
|
7
|
-
gem "appraisal"
|
8
|
-
gem "activerecord", "~> 3.2.22.2"
|
9
|
-
|
10
|
-
group :development do
|
11
|
-
gem "github_changelog_generator", "1.9.0"
|
12
|
-
end
|
13
|
-
|
14
|
-
group :test do
|
15
|
-
gem "minitest", "~> 5.0"
|
16
|
-
gem "test_after_commit", "~> 0.4.2"
|
17
|
-
gem "timecop"
|
18
|
-
gem "mocha"
|
19
|
-
gem "after_commit_exception_notification"
|
20
|
-
end
|
21
|
-
|
22
|
-
group :sqlite do
|
23
|
-
gem "sqlite3", "~> 1.3.13", platforms: [:ruby]
|
24
|
-
end
|
25
|
-
|
26
|
-
group :postgresql do
|
27
|
-
gem "pg", "~> 0.18.0", platforms: [:ruby]
|
28
|
-
end
|
29
|
-
|
30
|
-
group :mysql do
|
31
|
-
gem "mysql2", "~> 0.3.21", platforms: [:ruby]
|
32
|
-
end
|
33
|
-
|
34
|
-
gemspec path: "../"
|
data/gemfiles/rails_4_1.gemfile
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "http://rubygems.org"
|
4
|
-
|
5
|
-
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
|
-
gem "rake", "~> 12.2.0", platforms: [:ruby_19]
|
7
|
-
gem "appraisal"
|
8
|
-
gem "activerecord", "~> 4.1.16"
|
9
|
-
|
10
|
-
group :development do
|
11
|
-
gem "github_changelog_generator", "1.9.0"
|
12
|
-
end
|
13
|
-
|
14
|
-
group :test do
|
15
|
-
gem "minitest", "~> 5.0"
|
16
|
-
gem "test_after_commit", "~> 0.4.2"
|
17
|
-
gem "timecop"
|
18
|
-
gem "mocha"
|
19
|
-
gem "after_commit_exception_notification"
|
20
|
-
end
|
21
|
-
|
22
|
-
group :sqlite do
|
23
|
-
gem "sqlite3", "~> 1.3.13", platforms: [:ruby]
|
24
|
-
end
|
25
|
-
|
26
|
-
group :postgresql do
|
27
|
-
gem "pg", "~> 0.18.0", platforms: [:ruby]
|
28
|
-
end
|
29
|
-
|
30
|
-
group :mysql do
|
31
|
-
gem "mysql2", "~> 0.3.21", platforms: [:ruby]
|
32
|
-
end
|
33
|
-
|
34
|
-
gemspec path: "../"
|