acts_as_list 0.9.12 → 0.9.13

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
  SHA1:
3
- metadata.gz: 546373a5aef9b7e01d596125f12ca0d28a8ef17f
4
- data.tar.gz: 2c9dc883a96de73adef5721bf06d24c2ac6ed796
3
+ metadata.gz: bb0226cb2a1505d4baf4dce3e6987ac31f4468b4
4
+ data.tar.gz: d418ae9ae5b4db5c20dcdc5d056f5458c5823a92
5
5
  SHA512:
6
- metadata.gz: de4f9a7760a8a74b356398335ea14dfc9ae1fe120b46def4190f13db6b19720b2720a83ef5c4fc7c585255c49b0e232075631927b3106ce6b9a43844339d9627
7
- data.tar.gz: 32b9b84c6801e0bf4f2782e5285b03a4b60d98f2ec95cc5e78dd3fc906c67e73e63f6574f9ecfdd0a4e5ef161e51e4961d7de22ddc6ffae45f0acbd3e9c6ed7b
6
+ metadata.gz: 3819051f4dcdad3e3d88968138194d9c2572bb26738b06eb615746f8456d03954b822c0bc443e9f50da46b4b6d297516a286d02980c3f191827bea31666b3f6e
7
+ data.tar.gz: cd2c5e384d77e2c287905451d49bd7594a2562b41fd0e6334ed62a2ea38a543114f9798078f090aca5505247aec523acdf28d440b13d3dcdcb32580f466719d4
@@ -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) ([hooverlunch](https://github.com/hooverlunch))
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
- acts_as_list_list.where("#{quoted_position_column_with_table_name} > ?", position).decrement_all
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.
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module Acts
5
5
  module List
6
- VERSION = '0.9.12'
6
+ VERSION = '0.9.13'
7
7
  end
8
8
  end
9
9
  end
@@ -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.12
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-02 00:00:00.000000000 Z
13
+ date: 2018-06-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord