mongoid_orderable 6.0.5 → 6.0.6

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +101 -99
  3. data/LICENSE.txt +20 -20
  4. data/README.md +280 -275
  5. data/Rakefile +24 -24
  6. data/lib/config/locales/en.yml +12 -12
  7. data/lib/mongoid/orderable/configs/field_config.rb +81 -81
  8. data/lib/mongoid/orderable/configs/global_config.rb +26 -26
  9. data/lib/mongoid/orderable/errors/invalid_target_position.rb +19 -19
  10. data/lib/mongoid/orderable/errors/transaction_failed.rb +20 -20
  11. data/lib/mongoid/orderable/generators/base.rb +21 -21
  12. data/lib/mongoid/orderable/generators/helpers.rb +37 -37
  13. data/lib/mongoid/orderable/generators/listable.rb +41 -41
  14. data/lib/mongoid/orderable/generators/lock_collection.rb +39 -39
  15. data/lib/mongoid/orderable/generators/movable.rb +62 -62
  16. data/lib/mongoid/orderable/generators/position.rb +26 -26
  17. data/lib/mongoid/orderable/generators/scope.rb +26 -26
  18. data/lib/mongoid/orderable/handlers/base.rb +215 -215
  19. data/lib/mongoid/orderable/handlers/document.rb +32 -32
  20. data/lib/mongoid/orderable/handlers/document_embedded.rb +14 -14
  21. data/lib/mongoid/orderable/handlers/document_transactional.rb +32 -32
  22. data/lib/mongoid/orderable/handlers/transaction.rb +75 -75
  23. data/lib/mongoid/orderable/installer.rb +64 -64
  24. data/lib/mongoid/orderable/mixins/callbacks.rb +45 -45
  25. data/lib/mongoid/orderable/mixins/cascadeable.rb +15 -15
  26. data/lib/mongoid/orderable/mixins/helpers.rb +39 -39
  27. data/lib/mongoid/orderable/mixins/listable.rb +49 -49
  28. data/lib/mongoid/orderable/mixins/movable.rb +64 -64
  29. data/lib/mongoid/orderable/version.rb +7 -7
  30. data/lib/mongoid/orderable.rb +29 -29
  31. data/lib/mongoid_orderable.rb +34 -33
  32. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 130b0033ba55283b4cb619832e51b4b9c42191db02c12e0b9db87e98fb3c6cb8
4
- data.tar.gz: 24994768318208173add72989cf364c888137a739390d39f9759d35fbb8a2ce6
3
+ metadata.gz: 8aa24afe094eaa9ccb1f6c7e275d59f7b8219630bec83ad3f42c813489631cd4
4
+ data.tar.gz: b91011af6ad450b488ff82c57bc2e07181dfff0eaac4e65ca424fd754bf48734
5
5
  SHA512:
6
- metadata.gz: e401433fc0247621f99cebad69db3034f8b525a3d93035b8ec07c4deeb1116a5a1d568504e0ccfaeb23b8fe9f8fdd56ba5ef41add3526ed4e020b8a8b79f53ec
7
- data.tar.gz: 73c6c58d8a9da7e14a2e6f9f0866fbf3a7bedf194f81b44d9156387f57c4032f3fb2a04c8fe94dd49953d259b59c0f9f49c9f37778f3c773a3e61a9705965bbb
6
+ metadata.gz: 83e12a1cb61bc2b17d4ff33cbca0ee004c3d04360b414cb111caaccc0d57be054239417a2ff4bdc35030a7612f516e7476c7dff03c3984be5e8b11c347646202
7
+ data.tar.gz: 2e7c87452089acf630302775c0ece1ecd7eb71a52ab4c277de69bbea7049240a4d3657daad8531e9465f421d292d02ef81ee1c62963f0f7233a2413b3a43df8a
data/CHANGELOG.md CHANGED
@@ -1,99 +1,101 @@
1
- ### 6.0.6 (Next)
2
-
3
- * Your change here.
4
-
5
- ### 6.0.5 (2023/11/08)
6
-
7
- * [#75](https://github.com/mongoid/mongoid_orderable/pull/75): Fix: Preserve position when creating new records.
8
- * [#84](https://github.com/mongoid/mongoid_orderable/pull/84): Feature: Use Mongo::QueryCache if available.
9
- * [#85](https://github.com/mongoid/mongoid_orderable/pull/85): Refactor: Replace all usages of "protected" with "private".
10
-
11
- ### 6.0.4 (2023/02/01)
12
-
13
- * [#75](https://github.com/mongoid/mongoid_orderable/pull/75): Fix: Setting #move_to should mark an orderable object as changed so that callbacks are triggered.
14
-
15
- ### 6.0.3 (2021/06/27)
16
-
17
- * [#72](https://github.com/mongoid/mongoid_orderable/pull/72): Feature: Add :if and :unless conditions which disable callbacks.
18
- * [#71](https://github.com/mongoid/mongoid_orderable/pull/71): Fix: Add TTL index to locks table.
19
- * [#73](https://github.com/mongoid/mongoid_orderable/pull/73): Refactor: Replace Travis CI with Github Actions.
20
-
21
- ### 6.0.2 (2021/01/26)
22
-
23
- * [#70](https://github.com/mongoid/mongoid_orderable/pull/70): Fix: Transactions should not use around callbacks - [@johnnyshields](https://github.com/johnnyshields).
24
- * [#70](https://github.com/mongoid/mongoid_orderable/pull/70): Refactor: Partially reduce code complexity of handler classes - [@johnnyshields](https://github.com/johnnyshields).
25
- * [#70](https://github.com/mongoid/mongoid_orderable/pull/70): Tests: Run all tests both with and without transactions - [@johnnyshields](https://github.com/johnnyshields).
26
-
27
- ### 6.0.1 (2021/01/26)
28
-
29
- * [#69](https://github.com/mongoid/mongoid_orderable/pull/69): Fix: Transactions should force read from primary - [@johnnyshields](https://github.com/johnnyshields).
30
-
31
- ### 6.0.0 (2021/01/23)
32
-
33
- * [#65](https://github.com/mongoid/mongoid_orderable/pull/65): Feature: Add transaction support with lock table - [@johnnyshields](https://github.com/johnnyshields).
34
- * [#65](https://github.com/mongoid/mongoid_orderable/pull/65): Feature: Avoid calling position function if neither position nor scope is changing - [@johnnyshields](https://github.com/johnnyshields).
35
- * [#62](https://github.com/mongoid/mongoid_orderable/pull/62): Feature: Allow scope parameter to be an Array - [@johnnyshields](https://github.com/johnnyshields).
36
- * [#62](https://github.com/mongoid/mongoid_orderable/pull/62): Feature: Add global configurability - [@johnnyshields](https://github.com/johnnyshields).
37
- * [#65](https://github.com/mongoid/mongoid_orderable/pull/65): Fix: Do not run embedded destroy callbacks when the root object has been destroyed - [@johnnyshields](https://github.com/johnnyshields).
38
- * [#62](https://github.com/mongoid/mongoid_orderable/pull/62): Refactor: rename "column" to "field" - [@johnnyshields](https://github.com/johnnyshields).
39
- * [#60](https://github.com/mongoid/mongoid_orderable/pull/60): Refactor: Drop support for Mongoid 6.x and lower - [@johnnyshields](https://github.com/johnnyshields).
40
- * [#60](https://github.com/mongoid/mongoid_orderable/pull/60): Refactor: Remove Mongoid Compatibility (no longer needed) - [@johnnyshields](https://github.com/johnnyshields).
41
-
42
- ### 5.2.0 (2018/05/01)
43
-
44
- * [#57](https://github.com/mongoid/mongoid_orderable/pull/57): Compatibility with Mongoid 7 - [@tomasc](https://github.com/tomasc).
45
- * [#52](https://github.com/mongoid/mongoid_orderable/pull/52): Test against Mongoid 6 - [@dblock](https://github.com/dblock).
46
-
47
- ### 5.1.0 (2017/06/04)
48
-
49
- * [#50](https://github.com/mongoid/mongoid_orderable/pull/50): Added Danger, PR linter - [@dblock](https://github.com/dblock).
50
- * [#51](https://github.com/mongoid/mongoid_orderable/pull/51): Added RuboCop - [@dblock](https://github.com/dblock).
51
- * [#49](https://github.com/mongoid/mongoid_orderable/pull/49): Fix orderable on embedded documents inside an inherited model - [@rafaelgaspar](https://github.com/rafaelgaspar).
52
-
53
- ### 5.0.0 (2015/10/21)
54
-
55
- * [#41](https://github.com/mongoid/mongoid_orderable/pull/41): Mongoid 5 support - [@dblock](https://github.com/dblock).
56
- * [#41](https://github.com/mongoid/mongoid_orderable/pull/41): Dropped support for ruby 1.8 - [@dblock](https://github.com/dblock).
57
-
58
- ### 4.1.1 (2014/12/19)
59
-
60
- * [#34](https://github.com/mongoid/mongoid_orderable/pull/34): Fix: index should respect scope - [@joeyAghion](https://github.com/joeyAghion).
61
-
62
- ### 4.1.0 (2014/3/19)
63
-
64
- * [#30](https://github.com/mongoid/mongoid_orderable/pull/30): Fix: reset a single field when `orderable_scope` changed instead of removing it from list - [@Bharat311](https://github.com/Bharat311).
65
- * [#29](https://github.com/mongoid/mongoid_orderable/pull/29): Fix: incorrect position when orderable base is set - [@Bharat311](https://github.com/Bharat311).
66
- * [#28](https://github.com/mongoid/mongoid_orderable/pull/28): Inherited `orderable_configurations` - [@johnny-miyake](https://github.com/johnny-miyake).
67
- * [#27](https://github.com/mongoid/mongoid_orderable/pull/27): Allowed numeric string to specify a target position - [@johnny-miyake](https://github.com/johnny-miyake).
68
- * [#26](https://github.com/mongoid/mongoid_orderable/pull/26): Added support for multiple orderable fields - [@Bharat311](https://github.com/Bharat311).
69
- * [#22](https://github.com/mongoid/mongoid_orderable/pull/22): Added lazy support for scopes with different foreign key names - [@dsci](https://github.com/dsci).
70
- * [#21](https://github.com/mongoid/mongoid_orderable/pull/21): Accounting for change in Mongoid's metadata API - [@pjkelly](https://github.com/pjkelly).
71
- * [#20](https://github.com/mongoid/mongoid_orderable/pull/20): Added next and previous item methods - [@mrjlynch](https://github.com/mrjlynch).
72
- * [#19](https://github.com/mongoid/mongoid_orderable/pull/19): Added lower and higher item methods - [@mrjlynch](https://github.com/mrjlynch).
73
-
74
- ### 4.0.0 (2013/10/22)
75
-
76
- * [#18](https://github.com/mongoid/mongoid_orderable/pull/18): Added Mongoid 4 support - [@dblock](https://github.com/dblock).
77
- * [#16](https://github.com/mongoid/mongoid_orderable/pull/16): Fix for Mongoid identity map combined with scoped orderable - [@johnnyshields](https://github.com/johnnyshields).
78
- * [#15](https://github.com/mongoid/mongoid_orderable/pull/15): Support pass-thru of Mongoid field alias (`:as` parameter) - [@johnnyshields](https://github.com/johnnyshields).
79
- * [#13](https://github.com/mongoid/mongoid_orderable/pull/13): Support inheritance - [@zhengjia](https://github.com/zhengjia).
80
-
81
- ### 1.2.0 (2013/1/10)
82
-
83
- * [#12](https://github.com/mongoid/mongoid_orderable/pull/12): Added support for "base" in config options, in order to do a zero-based position - [@johnnyshields](https://github.com/johnnyshields).
84
-
85
- ### 1.1.0 (2012/5/23)
86
-
87
- * Added Mongoid 3 support - [@pyromaniac](https://github.com/pyromaniac).
88
-
89
- ### 1.0.0 (2012/2/14)
90
-
91
- * [#5](https://github.com/mongoid/mongoid_orderable/pull/5): Allow for use with default scopes - [@mattiassvedhem](https://github.com/mattiassvedhem).
92
-
93
- ### 0.9.1 (2012/2/3)
94
-
95
- ### 0.9.0 (2011/11/23)
96
-
97
- ### 0.0.1 (2011/11/1)
98
-
99
- * Initial public release - [@pyromaniac](https://github.com/pyromaniac).
1
+ ### 6.0.6 (2026/10/14)
2
+
3
+ * [#90](https://github.com/mongoid/mongoid_orderable/pull/90): Explicitly load Logger for modern ActiveSupport compatibility.
4
+ * [#91](https://github.com/mongoid/mongoid_orderable/pull/91): Add real SimpleCov coverage with one representative Coveralls reporting job and upstream-default-branch CI and coverage badges.
5
+ * [#90](https://github.com/mongoid/mongoid_orderable/pull/90): Modernize the GitHub Actions matrix through Ruby 4.0, Mongoid 9, and MongoDB Server 8.0 using container services and replica sets for transaction coverage.
6
+
7
+ ### 6.0.5 (2023/11/08)
8
+
9
+ * [#75](https://github.com/mongoid/mongoid_orderable/pull/75): Fix: Preserve position when creating new records.
10
+ * [#84](https://github.com/mongoid/mongoid_orderable/pull/84): Feature: Use Mongo::QueryCache if available.
11
+ * [#85](https://github.com/mongoid/mongoid_orderable/pull/85): Refactor: Replace all usages of "protected" with "private".
12
+
13
+ ### 6.0.4 (2023/02/01)
14
+
15
+ * [#75](https://github.com/mongoid/mongoid_orderable/pull/75): Fix: Setting #move_to should mark an orderable object as changed so that callbacks are triggered.
16
+
17
+ ### 6.0.3 (2021/06/27)
18
+
19
+ * [#72](https://github.com/mongoid/mongoid_orderable/pull/72): Feature: Add :if and :unless conditions which disable callbacks.
20
+ * [#71](https://github.com/mongoid/mongoid_orderable/pull/71): Fix: Add TTL index to locks table.
21
+ * [#73](https://github.com/mongoid/mongoid_orderable/pull/73): Refactor: Replace Travis CI with Github Actions.
22
+
23
+ ### 6.0.2 (2021/01/26)
24
+
25
+ * [#70](https://github.com/mongoid/mongoid_orderable/pull/70): Fix: Transactions should not use around callbacks - [@johnnyshields](https://github.com/johnnyshields).
26
+ * [#70](https://github.com/mongoid/mongoid_orderable/pull/70): Refactor: Partially reduce code complexity of handler classes - [@johnnyshields](https://github.com/johnnyshields).
27
+ * [#70](https://github.com/mongoid/mongoid_orderable/pull/70): Tests: Run all tests both with and without transactions - [@johnnyshields](https://github.com/johnnyshields).
28
+
29
+ ### 6.0.1 (2021/01/26)
30
+
31
+ * [#69](https://github.com/mongoid/mongoid_orderable/pull/69): Fix: Transactions should force read from primary - [@johnnyshields](https://github.com/johnnyshields).
32
+
33
+ ### 6.0.0 (2021/01/23)
34
+
35
+ * [#65](https://github.com/mongoid/mongoid_orderable/pull/65): Feature: Add transaction support with lock table - [@johnnyshields](https://github.com/johnnyshields).
36
+ * [#65](https://github.com/mongoid/mongoid_orderable/pull/65): Feature: Avoid calling position function if neither position nor scope is changing - [@johnnyshields](https://github.com/johnnyshields).
37
+ * [#62](https://github.com/mongoid/mongoid_orderable/pull/62): Feature: Allow scope parameter to be an Array - [@johnnyshields](https://github.com/johnnyshields).
38
+ * [#62](https://github.com/mongoid/mongoid_orderable/pull/62): Feature: Add global configurability - [@johnnyshields](https://github.com/johnnyshields).
39
+ * [#65](https://github.com/mongoid/mongoid_orderable/pull/65): Fix: Do not run embedded destroy callbacks when the root object has been destroyed - [@johnnyshields](https://github.com/johnnyshields).
40
+ * [#62](https://github.com/mongoid/mongoid_orderable/pull/62): Refactor: rename "column" to "field" - [@johnnyshields](https://github.com/johnnyshields).
41
+ * [#60](https://github.com/mongoid/mongoid_orderable/pull/60): Refactor: Drop support for Mongoid 6.x and lower - [@johnnyshields](https://github.com/johnnyshields).
42
+ * [#60](https://github.com/mongoid/mongoid_orderable/pull/60): Refactor: Remove Mongoid Compatibility (no longer needed) - [@johnnyshields](https://github.com/johnnyshields).
43
+
44
+ ### 5.2.0 (2018/05/01)
45
+
46
+ * [#57](https://github.com/mongoid/mongoid_orderable/pull/57): Compatibility with Mongoid 7 - [@tomasc](https://github.com/tomasc).
47
+ * [#52](https://github.com/mongoid/mongoid_orderable/pull/52): Test against Mongoid 6 - [@dblock](https://github.com/dblock).
48
+
49
+ ### 5.1.0 (2017/06/04)
50
+
51
+ * [#50](https://github.com/mongoid/mongoid_orderable/pull/50): Added Danger, PR linter - [@dblock](https://github.com/dblock).
52
+ * [#51](https://github.com/mongoid/mongoid_orderable/pull/51): Added RuboCop - [@dblock](https://github.com/dblock).
53
+ * [#49](https://github.com/mongoid/mongoid_orderable/pull/49): Fix orderable on embedded documents inside an inherited model - [@rafaelgaspar](https://github.com/rafaelgaspar).
54
+
55
+ ### 5.0.0 (2015/10/21)
56
+
57
+ * [#41](https://github.com/mongoid/mongoid_orderable/pull/41): Mongoid 5 support - [@dblock](https://github.com/dblock).
58
+ * [#41](https://github.com/mongoid/mongoid_orderable/pull/41): Dropped support for ruby 1.8 - [@dblock](https://github.com/dblock).
59
+
60
+ ### 4.1.1 (2014/12/19)
61
+
62
+ * [#34](https://github.com/mongoid/mongoid_orderable/pull/34): Fix: index should respect scope - [@joeyAghion](https://github.com/joeyAghion).
63
+
64
+ ### 4.1.0 (2014/3/19)
65
+
66
+ * [#30](https://github.com/mongoid/mongoid_orderable/pull/30): Fix: reset a single field when `orderable_scope` changed instead of removing it from list - [@Bharat311](https://github.com/Bharat311).
67
+ * [#29](https://github.com/mongoid/mongoid_orderable/pull/29): Fix: incorrect position when orderable base is set - [@Bharat311](https://github.com/Bharat311).
68
+ * [#28](https://github.com/mongoid/mongoid_orderable/pull/28): Inherited `orderable_configurations` - [@johnny-miyake](https://github.com/johnny-miyake).
69
+ * [#27](https://github.com/mongoid/mongoid_orderable/pull/27): Allowed numeric string to specify a target position - [@johnny-miyake](https://github.com/johnny-miyake).
70
+ * [#26](https://github.com/mongoid/mongoid_orderable/pull/26): Added support for multiple orderable fields - [@Bharat311](https://github.com/Bharat311).
71
+ * [#22](https://github.com/mongoid/mongoid_orderable/pull/22): Added lazy support for scopes with different foreign key names - [@dsci](https://github.com/dsci).
72
+ * [#21](https://github.com/mongoid/mongoid_orderable/pull/21): Accounting for change in Mongoid's metadata API - [@pjkelly](https://github.com/pjkelly).
73
+ * [#20](https://github.com/mongoid/mongoid_orderable/pull/20): Added next and previous item methods - [@mrjlynch](https://github.com/mrjlynch).
74
+ * [#19](https://github.com/mongoid/mongoid_orderable/pull/19): Added lower and higher item methods - [@mrjlynch](https://github.com/mrjlynch).
75
+
76
+ ### 4.0.0 (2013/10/22)
77
+
78
+ * [#18](https://github.com/mongoid/mongoid_orderable/pull/18): Added Mongoid 4 support - [@dblock](https://github.com/dblock).
79
+ * [#16](https://github.com/mongoid/mongoid_orderable/pull/16): Fix for Mongoid identity map combined with scoped orderable - [@johnnyshields](https://github.com/johnnyshields).
80
+ * [#15](https://github.com/mongoid/mongoid_orderable/pull/15): Support pass-thru of Mongoid field alias (`:as` parameter) - [@johnnyshields](https://github.com/johnnyshields).
81
+ * [#13](https://github.com/mongoid/mongoid_orderable/pull/13): Support inheritance - [@zhengjia](https://github.com/zhengjia).
82
+
83
+ ### 1.2.0 (2013/1/10)
84
+
85
+ * [#12](https://github.com/mongoid/mongoid_orderable/pull/12): Added support for "base" in config options, in order to do a zero-based position - [@johnnyshields](https://github.com/johnnyshields).
86
+
87
+ ### 1.1.0 (2012/5/23)
88
+
89
+ * Added Mongoid 3 support - [@pyromaniac](https://github.com/pyromaniac).
90
+
91
+ ### 1.0.0 (2012/2/14)
92
+
93
+ * [#5](https://github.com/mongoid/mongoid_orderable/pull/5): Allow for use with default scopes - [@mattiassvedhem](https://github.com/mattiassvedhem).
94
+
95
+ ### 0.9.1 (2012/2/3)
96
+
97
+ ### 0.9.0 (2011/11/23)
98
+
99
+ ### 0.0.1 (2011/11/1)
100
+
101
+ * Initial public release - [@pyromaniac](https://github.com/pyromaniac).
data/LICENSE.txt CHANGED
@@ -1,20 +1,20 @@
1
- Copyright (c) 2011-2017 Arkadiy Zabazhanov & Contributors
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ Copyright (c) 2011-2017 Arkadiy Zabazhanov & Contributors
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.