acts_as_list 0.9.15 → 0.9.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +1 -1
- data/CHANGELOG.md +7 -0
- data/Gemfile +4 -1
- data/gemfiles/rails_3_2.gemfile +4 -1
- data/gemfiles/rails_4_1.gemfile +4 -1
- data/gemfiles/rails_4_2.gemfile +4 -1
- data/gemfiles/rails_5_0.gemfile +4 -1
- data/gemfiles/rails_5_1.gemfile +4 -1
- data/gemfiles/rails_5_2.gemfile +4 -1
- data/lib/acts_as_list/active_record/acts/list.rb +1 -1
- data/lib/acts_as_list/version.rb +1 -1
- data/test/helper.rb +1 -1
- data/test/test_default_scope_with_select.rb +33 -0
- data/test/test_no_update_for_subclasses.rb +7 -7
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 370205f3c55e44c0633e2aabc665fa4489bf4e4c
|
4
|
+
data.tar.gz: 2ce434302042df344231d3b8cb4fc053ba2c39af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bc4009e669c92bc3822baa35d9560c54d66cd32ef950fad5f2c0f1ff1f6f04cc5d3f747265fc1a7462bf0118ba917aff33256dde5037cfa2398dbe34f6e140b
|
7
|
+
data.tar.gz: 6ee14901baf239084f2c31fa89e63d50b92e6de9113f91cecb3db18f0dae751cbfd50eb5578bd6d4960c6427dc5cfef0f6ab73e167b1d45e1dbe6f4286c0a806
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.9.15](https://github.com/swanandp/acts_as_list/tree/v0.9.15) (2018-06-11)
|
4
|
+
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.14...v0.9.15)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Fix \#314: `no\_update` is not applied to subclasses [\#315](https://github.com/swanandp/acts_as_list/pull/315) ([YoranBrondsema](https://github.com/YoranBrondsema))
|
9
|
+
|
3
10
|
## [v0.9.14](https://github.com/swanandp/acts_as_list/tree/v0.9.14) (2018-06-05)
|
4
11
|
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.13...v0.9.14)
|
5
12
|
|
data/Gemfile
CHANGED
data/gemfiles/rails_3_2.gemfile
CHANGED
@@ -5,9 +5,12 @@ source "http://rubygems.org"
|
|
5
5
|
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
6
|
gem "rake"
|
7
7
|
gem "appraisal"
|
8
|
-
gem "github_changelog_generator", "1.9.0"
|
9
8
|
gem "activerecord", "~> 3.2.22.2"
|
10
9
|
|
10
|
+
group :development do
|
11
|
+
gem "github_changelog_generator", "1.9.0"
|
12
|
+
end
|
13
|
+
|
11
14
|
group :test do
|
12
15
|
gem "minitest", "~> 5.0"
|
13
16
|
gem "test_after_commit", "~> 0.4.2"
|
data/gemfiles/rails_4_1.gemfile
CHANGED
@@ -5,9 +5,12 @@ source "http://rubygems.org"
|
|
5
5
|
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
6
|
gem "rake"
|
7
7
|
gem "appraisal"
|
8
|
-
gem "github_changelog_generator", "1.9.0"
|
9
8
|
gem "activerecord", "~> 4.1.16"
|
10
9
|
|
10
|
+
group :development do
|
11
|
+
gem "github_changelog_generator", "1.9.0"
|
12
|
+
end
|
13
|
+
|
11
14
|
group :test do
|
12
15
|
gem "minitest", "~> 5.0"
|
13
16
|
gem "test_after_commit", "~> 0.4.2"
|
data/gemfiles/rails_4_2.gemfile
CHANGED
@@ -5,9 +5,12 @@ source "http://rubygems.org"
|
|
5
5
|
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
6
|
gem "rake"
|
7
7
|
gem "appraisal"
|
8
|
-
gem "github_changelog_generator", "1.9.0"
|
9
8
|
gem "activerecord", "~> 4.2.10"
|
10
9
|
|
10
|
+
group :development do
|
11
|
+
gem "github_changelog_generator", "1.9.0"
|
12
|
+
end
|
13
|
+
|
11
14
|
group :test do
|
12
15
|
gem "minitest", "~> 5.0"
|
13
16
|
gem "test_after_commit", "~> 0.4.2"
|
data/gemfiles/rails_5_0.gemfile
CHANGED
@@ -5,9 +5,12 @@ source "http://rubygems.org"
|
|
5
5
|
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
6
|
gem "rake"
|
7
7
|
gem "appraisal"
|
8
|
-
gem "github_changelog_generator", "1.9.0"
|
9
8
|
gem "activerecord", "~> 5.0.6"
|
10
9
|
|
10
|
+
group :development do
|
11
|
+
gem "github_changelog_generator", "1.9.0"
|
12
|
+
end
|
13
|
+
|
11
14
|
group :test do
|
12
15
|
gem "minitest", "~> 5.0"
|
13
16
|
gem "test_after_commit", "~> 0.4.2"
|
data/gemfiles/rails_5_1.gemfile
CHANGED
@@ -5,9 +5,12 @@ source "http://rubygems.org"
|
|
5
5
|
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
6
|
gem "rake"
|
7
7
|
gem "appraisal"
|
8
|
-
gem "github_changelog_generator", "1.9.0"
|
9
8
|
gem "activerecord", "~> 5.1.4"
|
10
9
|
|
10
|
+
group :development do
|
11
|
+
gem "github_changelog_generator", "1.9.0"
|
12
|
+
end
|
13
|
+
|
11
14
|
group :test do
|
12
15
|
gem "minitest", "~> 5.0"
|
13
16
|
gem "test_after_commit", "~> 0.4.2"
|
data/gemfiles/rails_5_2.gemfile
CHANGED
@@ -5,9 +5,12 @@ source "http://rubygems.org"
|
|
5
5
|
gem "rack", "~> 1", platforms: [:ruby_19, :ruby_20, :ruby_21]
|
6
6
|
gem "rake"
|
7
7
|
gem "appraisal"
|
8
|
-
gem "github_changelog_generator", "1.9.0"
|
9
8
|
gem "activerecord", "~> 5.2.0.rc1"
|
10
9
|
|
10
|
+
group :development do
|
11
|
+
gem "github_changelog_generator", "1.9.0"
|
12
|
+
end
|
13
|
+
|
11
14
|
group :test do
|
12
15
|
gem "minitest", "~> 5.0"
|
13
16
|
gem "test_after_commit", "~> 0.4.2"
|
data/lib/acts_as_list/version.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class Animal < ActiveRecord::Base
|
4
|
+
acts_as_list
|
5
|
+
default_scope -> { select(:name) }
|
6
|
+
end
|
7
|
+
|
8
|
+
class DefaultScopeWithSelectTest < Minitest::Test
|
9
|
+
def setup
|
10
|
+
ActiveRecord::Base.connection.create_table :animals do |t|
|
11
|
+
t.column :position, :integer
|
12
|
+
t.column :name, :string
|
13
|
+
end
|
14
|
+
|
15
|
+
ActiveRecord::Base.connection.schema_cache.clear!
|
16
|
+
Animal.reset_column_information
|
17
|
+
super
|
18
|
+
end
|
19
|
+
|
20
|
+
def teardown
|
21
|
+
teardown_db
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_default_scope_with_select
|
26
|
+
animal1 = Animal.create name: 'Fox'
|
27
|
+
animal2 = Animal.create name: 'Panda'
|
28
|
+
animal3 = Animal.create name: 'Wildebeast'
|
29
|
+
assert_equal 1, animal1.position
|
30
|
+
assert_equal 2, animal2.position
|
31
|
+
assert_equal 3, animal3.position
|
32
|
+
end
|
33
|
+
end
|
@@ -2,21 +2,21 @@
|
|
2
2
|
|
3
3
|
require 'helper'
|
4
4
|
|
5
|
-
class
|
5
|
+
class MasterItem < ActiveRecord::Base
|
6
6
|
acts_as_list
|
7
7
|
end
|
8
8
|
|
9
|
-
class
|
9
|
+
class SlaveItem < MasterItem; end
|
10
10
|
|
11
11
|
class NoUpdateForSubclassesTestCase < Minitest::Test
|
12
12
|
def setup
|
13
|
-
ActiveRecord::Base.connection.create_table :
|
13
|
+
ActiveRecord::Base.connection.create_table :master_items do |t|
|
14
14
|
t.column :position, :integer
|
15
15
|
t.column :type, :string
|
16
16
|
end
|
17
17
|
|
18
18
|
ActiveRecord::Base.connection.schema_cache.clear!
|
19
|
-
[
|
19
|
+
[MasterItem, SlaveItem].each(&:reset_column_information)
|
20
20
|
super
|
21
21
|
end
|
22
22
|
|
@@ -30,7 +30,7 @@ class NoUpdateForSubclassesTest < NoUpdateForSubclassesTestCase
|
|
30
30
|
def setup
|
31
31
|
super
|
32
32
|
@item_1, @item_2 = (1..2).map do |counter|
|
33
|
-
|
33
|
+
SlaveItem.create!(position: counter)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -41,14 +41,14 @@ class NoUpdateForSubclassesTest < NoUpdateForSubclassesTestCase
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_no_update_for_subclass_instances_with_no_update_on_superclass
|
44
|
-
|
44
|
+
MasterItem.acts_as_list_no_update { @item_1.update_attributes(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
|
-
|
51
|
+
SlaveItem.acts_as_list_no_update { @item_1.update_attributes(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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- test/shared_quoting.rb
|
89
89
|
- test/shared_top_addition.rb
|
90
90
|
- test/shared_zero_based.rb
|
91
|
+
- test/test_default_scope_with_select.rb
|
91
92
|
- test/test_joined_list.rb
|
92
93
|
- test/test_list.rb
|
93
94
|
- test/test_no_update_for_extra_classes.rb
|
@@ -129,6 +130,7 @@ test_files:
|
|
129
130
|
- test/shared_quoting.rb
|
130
131
|
- test/shared_top_addition.rb
|
131
132
|
- test/shared_zero_based.rb
|
133
|
+
- test/test_default_scope_with_select.rb
|
132
134
|
- test/test_joined_list.rb
|
133
135
|
- test/test_list.rb
|
134
136
|
- test/test_no_update_for_extra_classes.rb
|