acts_as_list 0.9.12 → 0.9.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/lib/acts_as_list/active_record/acts/list.rb +8 -1
- data/lib/acts_as_list/version.rb +1 -1
- data/test/test_list.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb0226cb2a1505d4baf4dce3e6987ac31f4468b4
|
4
|
+
data.tar.gz: d418ae9ae5b4db5c20dcdc5d056f5458c5823a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3819051f4dcdad3e3d88968138194d9c2572bb26738b06eb615746f8456d03954b822c0bc443e9f50da46b4b6d297516a286d02980c3f191827bea31666b3f6e
|
7
|
+
data.tar.gz: cd2c5e384d77e2c287905451d49bd7594a2562b41fd0e6334ed62a2ea38a543114f9798078f090aca5505247aec523acdf28d440b13d3dcdcb32580f466719d4
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.9.12](https://github.com/swanandp/acts_as_list/tree/v0.9.12) (2018-05-02)
|
4
|
+
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.11...v0.9.12)
|
5
|
+
|
6
|
+
**Closed issues:**
|
7
|
+
|
8
|
+
- acts\_as\_list methods on has\_many through [\#308](https://github.com/swanandp/acts_as_list/issues/308)
|
9
|
+
- Travis badge [\#307](https://github.com/swanandp/acts_as_list/issues/307)
|
10
|
+
- Unscoping breaks STI subclasses, but is soon to be fixed in Rails [\#291](https://github.com/swanandp/acts_as_list/issues/291)
|
11
|
+
- Refactor string eval for scope\_condition [\#227](https://github.com/swanandp/acts_as_list/issues/227)
|
12
|
+
|
13
|
+
**Merged pull requests:**
|
14
|
+
|
15
|
+
- mocha/minitest, not mocha/mini\_test now. [\#310](https://github.com/swanandp/acts_as_list/pull/310) ([jmarkbrooks](https://github.com/jmarkbrooks))
|
16
|
+
|
3
17
|
## [v0.9.11](https://github.com/swanandp/acts_as_list/tree/v0.9.11) (2018-03-19)
|
4
18
|
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.10...v0.9.11)
|
5
19
|
|
@@ -37,7 +51,7 @@
|
|
37
51
|
|
38
52
|
**Merged pull requests:**
|
39
53
|
|
40
|
-
- Added fixed values option for scope array [\#286](https://github.com/swanandp/acts_as_list/pull/286) ([
|
54
|
+
- Added fixed values option for scope array [\#286](https://github.com/swanandp/acts_as_list/pull/286) ([smoyth](https://github.com/smoyth))
|
41
55
|
|
42
56
|
## [v0.9.8](https://github.com/swanandp/acts_as_list/tree/v0.9.8) (2017-09-28)
|
43
57
|
[Full Changelog](https://github.com/swanandp/acts_as_list/compare/v0.9.7...v0.9.8)
|
@@ -327,7 +327,14 @@ module ActiveRecord
|
|
327
327
|
def decrement_positions_on_lower_items(position=nil)
|
328
328
|
return unless in_list?
|
329
329
|
position ||= send(position_column).to_i
|
330
|
-
|
330
|
+
|
331
|
+
if sequential_updates?
|
332
|
+
acts_as_list_list.where("#{quoted_position_column_with_table_name} > ?", position).reorder(acts_as_list_order_argument(:asc)).each do |item|
|
333
|
+
item.decrement!(position_column)
|
334
|
+
end
|
335
|
+
else
|
336
|
+
acts_as_list_list.where("#{quoted_position_column_with_table_name} > ?", position).decrement_all
|
337
|
+
end
|
331
338
|
end
|
332
339
|
|
333
340
|
# Increments position (<tt>position_column</tt>) of all items in the list.
|
data/lib/acts_as_list/version.rb
CHANGED
data/test/test_list.rb
CHANGED
@@ -888,4 +888,16 @@ class SequentialUpdatesMixinNotNullUniquePositiveConstraintsTest < ActsAsListTes
|
|
888
888
|
new.insert_at(3)
|
889
889
|
assert_equal 3, new.pos
|
890
890
|
end
|
891
|
+
|
892
|
+
def test_destroy
|
893
|
+
new_item = SequentialUpdatesDefault.create
|
894
|
+
assert_equal 5, new_item.pos
|
895
|
+
|
896
|
+
new_item.insert_at(2)
|
897
|
+
assert_equal 2, new_item.pos
|
898
|
+
|
899
|
+
new_item.destroy
|
900
|
+
assert_equal [1,2,3,4], SequentialUpdatesDefault.all.map(&:pos).sort
|
901
|
+
|
902
|
+
end
|
891
903
|
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.13
|
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-05
|
13
|
+
date: 2018-06-05 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|