acts_as_list 0.9.14 → 0.9.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/acts_as_list/active_record/acts/no_update.rb +1 -1
- data/lib/acts_as_list/version.rb +1 -1
- data/test/test_no_update_for_subclasses.rb +56 -0
- 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: a9a0291b66db99525acb7519c4f07f6213807fab
|
4
|
+
data.tar.gz: 2bd62327801108c1b2e352b60334457a2c61f5ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 712b360a8fd332f72fd8ecc3df598f0bdc42d048a14c2662e26f0001af55dbb0c75848cfec246ac2f446eaff3152d7007fc5b7234464b27d4cebda202223e44e
|
7
|
+
data.tar.gz: cc181d9cd3b8644796aebe0ce6e09ebf166fc89970c5617bd56c968a19ac18c3c97f5e8a60d78ac39011b74ab9e09804414844eb18e191052bb3bc9f8a082adb
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.9.14](https://github.com/swanandp/acts_as_list/tree/v0.9.14) (2018-06-05)
|
4
|
+
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.13...v0.9.14)
|
5
|
+
|
6
|
+
**Closed issues:**
|
7
|
+
|
8
|
+
- `insert\_at` saves invalid ActiveRecord objects [\#311](https://github.com/swanandp/acts_as_list/issues/311)
|
9
|
+
|
10
|
+
**Merged pull requests:**
|
11
|
+
|
12
|
+
- \#311 Don't insert invalid ActiveRecord objects [\#312](https://github.com/swanandp/acts_as_list/pull/312) ([seanabrahams](https://github.com/seanabrahams))
|
13
|
+
|
3
14
|
## [v0.9.13](https://github.com/swanandp/acts_as_list/tree/v0.9.13) (2018-06-05)
|
4
15
|
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.12...v0.9.13)
|
5
16
|
|
data/lib/acts_as_list/version.rb
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'helper'
|
4
|
+
|
5
|
+
class TodoItem < ActiveRecord::Base
|
6
|
+
acts_as_list
|
7
|
+
end
|
8
|
+
|
9
|
+
class SubTodoItem < TodoItem; end
|
10
|
+
|
11
|
+
class NoUpdateForSubclassesTestCase < Minitest::Test
|
12
|
+
def setup
|
13
|
+
ActiveRecord::Base.connection.create_table :todo_items do |t|
|
14
|
+
t.column :position, :integer
|
15
|
+
t.column :type, :string
|
16
|
+
end
|
17
|
+
|
18
|
+
ActiveRecord::Base.connection.schema_cache.clear!
|
19
|
+
[TodoItem, SubTodoItem].each(&:reset_column_information)
|
20
|
+
super
|
21
|
+
end
|
22
|
+
|
23
|
+
def teardown
|
24
|
+
teardown_db
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
class NoUpdateForSubclassesTest < NoUpdateForSubclassesTestCase
|
30
|
+
def setup
|
31
|
+
super
|
32
|
+
@item_1, @item_2 = (1..2).map do |counter|
|
33
|
+
SubTodoItem.create!(position: counter)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_update
|
38
|
+
@item_1.update_attributes(position: 2)
|
39
|
+
assert_equal 2, @item_1.reload.position
|
40
|
+
assert_equal 1, @item_2.reload.position
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_no_update_for_subclass_instances_with_no_update_on_superclass
|
44
|
+
TodoItem.acts_as_list_no_update { @item_1.update_attributes(position: 2) }
|
45
|
+
|
46
|
+
assert_equal 2, @item_1.reload.position
|
47
|
+
assert_equal 2, @item_2.reload.position
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_no_update_for_subclass_instances_with_no_update_on_subclass
|
51
|
+
SubTodoItem.acts_as_list_no_update { @item_1.update_attributes(position: 2) }
|
52
|
+
|
53
|
+
assert_equal 2, @item_1.reload.position
|
54
|
+
assert_equal 2, @item_2.reload.position
|
55
|
+
end
|
56
|
+
end
|
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.15
|
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-06-
|
13
|
+
date: 2018-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- test/test_list.rb
|
93
93
|
- test/test_no_update_for_extra_classes.rb
|
94
94
|
- test/test_no_update_for_scope_destruction.rb
|
95
|
+
- test/test_no_update_for_subclasses.rb
|
95
96
|
homepage: http://github.com/swanandp/acts_as_list
|
96
97
|
licenses:
|
97
98
|
- MIT
|
@@ -132,3 +133,4 @@ test_files:
|
|
132
133
|
- test/test_list.rb
|
133
134
|
- test/test_no_update_for_extra_classes.rb
|
134
135
|
- test/test_no_update_for_scope_destruction.rb
|
136
|
+
- test/test_no_update_for_subclasses.rb
|