mongoid_orderable 6.0.5 → 6.0.7

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 +105 -99
  3. data/LICENSE.txt +20 -20
  4. data/README.md +296 -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 +218 -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 +45 -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
data/README.md CHANGED
@@ -1,275 +1,296 @@
1
- [![Gem Version](https://badge.fury.io/rb/mongoid_orderable.svg)](https://badge.fury.io/rb/mongoid_orderable)
2
- [![Build Status](https://travis-ci.org/mongoid/mongoid_orderable.svg?branch=master)](https://travis-ci.org/mongoid/mongoid_orderable)
3
-
4
- # Mongoid Orderable
5
-
6
- Mongoid::Orderable is a ordered list implementation for your Mongoid 7+ projects.
7
-
8
- ### Core Features
9
-
10
- * Sets a position index field on your documents which allows you to sort them in order.
11
- * Uses MongoDB's `$inc` operator to batch-update position.
12
- * Supports scope for position index, including changing scopes.
13
- * Supports multiple position indexes on the same document.
14
- * (Optional) Uses [MongoDB transactions](https://docs.mongodb.com/manual/core/transactions/) to ensure order integrity during concurrent updates.
15
-
16
- ### Version Support
17
-
18
- As of version 6.0.0, Mongoid::Orderable supports the following dependency versions:
19
-
20
- * Ruby 2.6+
21
- * Mongoid 7.0+
22
- * Rails 5.2+
23
-
24
- For older versions, please use Mongoid::Orderable 5.x and earlier.
25
-
26
- Transaction support requires MongoDB 4.2+ (4.4+ recommended.)
27
-
28
- ## Usage
29
-
30
- ### Getting Started
31
-
32
- ```ruby
33
- gem 'mongoid_orderable'
34
- ```
35
-
36
- Include `Mongoid::Orderable` into your model and call `orderable` method.
37
- Embedded objects are automatically scoped to their parent.
38
-
39
- ```ruby
40
- class MyModel
41
- include Mongoid::Document
42
- include Mongoid::Orderable
43
-
44
- belongs_to :group
45
- belongs_to :drawer, class_name: "Office::Drawer",
46
- foreign_key: "legacy_drawer_key_id"
47
-
48
- orderable
49
-
50
- # if you set :scope as a symbol, it will resolve the foreign key from relation
51
- orderable scope: :drawer, field: :pos
52
-
53
- # if you set :scope as a string, it will use it as the field name for scope
54
- orderable scope: 'drawer', field: :pos
55
-
56
- # scope can also be a proc
57
- orderable scope: ->(doc) { where(group_id: doc.group_id) }
58
-
59
- # this one if you want specify indexes manually
60
- orderable index: false
61
-
62
- # count position from zero as the top-most value (1 is the default value)
63
- orderable base: 0
64
- end
65
- ```
66
-
67
- You can also set default config values in an initializer, which will be
68
- applied when calling the `orderable` macro in a model.
69
-
70
- ```ruby
71
- # configs/initializers/mongoid_orderable.rb
72
- Mongoid::Orderable.configure do |config|
73
- config.field = :pos
74
- config.base = 0
75
- config.index = false
76
- end
77
- ```
78
-
79
- ### Moving Position
80
-
81
- ```ruby
82
- item.move_to 2 # just change position
83
- item.move_to! 2 # and save
84
- item.move_to = 2 # assignable method
85
-
86
- # symbol position
87
- item.move_to :top
88
- item.move_to :bottom
89
- item.move_to :higher
90
- item.move_to :lower
91
-
92
- # generated methods
93
- item.move_to_top
94
- item.move_to_bottom
95
- item.move_higher
96
- item.move_lower
97
-
98
- item.next_items # return a collection of items higher on the list
99
- item.previous_items # return a collection of items lower on the list
100
-
101
- item.next_item # returns the next item in the list
102
- item.previous_item # returns the previous item in the list
103
- ```
104
-
105
- ### Multiple Fields
106
-
107
- You can also define multiple orderable fields for any class including the Mongoid::Orderable module.
108
-
109
- ```ruby
110
- class Book
111
- include Mongoid::Document
112
- include Mongoid::Orderable
113
-
114
- orderable base: 0
115
- orderable field: sno, as: :serial_no
116
- end
117
- ```
118
-
119
- The above defines two different orderable_fields on Book - *position* and *serial_no*.
120
- The following helpers are generated in this case:
121
-
122
- ```ruby
123
- book.move_#{field}_to
124
- book.move_#{field}_to=
125
- book.move_#{field}_to!
126
-
127
- book.move_#{field}_to_top
128
- book.move_#{field}_to_bottom
129
- book.move_#{field}_higher
130
- book.move_#{field}_lower
131
-
132
- book.next_#{field}_items
133
- book.previous_#{field}_items
134
-
135
- book.next_#{field}_item
136
- book.previous_#{field}_item
137
- ```
138
-
139
- where `#{field}` is either `position` or `serial_no`.
140
-
141
- When a model defines multiple orderable fields, the original helpers are also available and work
142
- on the first orderable field.
143
-
144
- ```ruby
145
- @book1 = Book.create!
146
- @book2 = Book.create!
147
- @book2 # => <Book _id: 53a16a2ba1bde4f746000001, serial_no: 1, position: 1>
148
- @book2.move_to! :top # this will change the :position of the book to 0 (not serial_no)
149
- @book2 # => <Book _id: 53a16a2ba1bde4f746000001, serial_no: 1, position: 0>
150
- ```
151
-
152
- To specify any other orderable field as default pass the **default: true** option with orderable.
153
-
154
- ```ruby
155
- orderable field: sno, as: :serial_no, default: true
156
- ```
157
-
158
- ### Embedded Documents
159
-
160
- ```ruby
161
- class Question
162
- include Mongoid::Document
163
- include Mongoid::Orderable
164
-
165
- embedded_in :survey
166
-
167
- orderable
168
- end
169
- ```
170
-
171
- If you bulk import embedded documents without specifying their position,
172
- no field `position` will be written.
173
-
174
- ```ruby
175
- class Survey
176
- include Mongoid::Document
177
-
178
- embeds_many :questions, cascade_callbacks: true
179
- end
180
- ```
181
-
182
- To ensure the position is written correctly, you will need to set
183
- `cascade_callbacks: true` on the relation.
184
-
185
- ### Disable Ordering
186
-
187
- You can disable position tracking for specific documents using the `:if` and `:unless` options.
188
- This is in advanced scenarios where you want to control position manually for certain documents.
189
- In general, the disable condition should match a specific scope.
190
- **Warning:** If used improperly, this will cause your documents to become out-of-order.
191
-
192
- ```ruby
193
- class Book
194
- include Mongoid::Document
195
- include Mongoid::Orderable
196
-
197
- field :track_position, type: Boolean
198
-
199
- orderable if: :track_position, unless: -> { created_at < Date.parse('2020-01-01') }
200
- end
201
- ```
202
-
203
- ## Transaction Support
204
-
205
- By default, Mongoid Orderable does not guarantee ordering consistency
206
- when doing multiple concurrent updates on documents. This means that
207
- instead of having positions `1, 2, 3, 4, 5`, after running your system
208
- in production at scale your position data will become corrupted, e.g.
209
- `1, 1, 4, 4, 6`. To remedy this, this Mongoid Orderable can use
210
- [MongoDB transactions](https://docs.mongodb.com/manual/core/transactions/)
211
-
212
- ### Prerequisites
213
-
214
- * MongoDB version 4.2+ (4.4+ recommended.)
215
- * Requires [MongoDB Replica Set](https://docs.mongodb.com/manual/tutorial/deploy-replica-set/) topology
216
-
217
- ### Configuration
218
-
219
- You may enable transactions on both the global and model configs:
220
-
221
- ```ruby
222
- Mongoid::Orderable.configure do |config|
223
- config.use_transactions = true # default: false
224
- config.transaction_max_retries = 10 # default: 10
225
- end
226
-
227
- class MyModel
228
- orderable :position, use_transactions: false
229
- end
230
- ```
231
-
232
- When two transactions are attempted at the same time, database-level
233
- `WriteConflict` failures may result and retries will be attempted.
234
- After `transaction_max_retries` has been exceeded, a
235
- `Mongoid::Orderable::Errors::TransactionFailed` error will be raised.
236
-
237
- ### Locks
238
-
239
- When using transactions, Mongoid Orderable creates a collection
240
- `mongoid_orderable_locks` which is used to store temporary lock objects.
241
- Lock collections use a TTL index which auto-deletes objects older than 1 day.
242
-
243
- You can change the lock collection name globally or per model:
244
-
245
- ```ruby
246
- Mongoid::Orderable.configure do |config|
247
- config.lock_collection = "my_locks" # default: "mongoid_orderable_locks"
248
- end
249
-
250
- class MyModel
251
- orderable :position, lock_collection: "my_model_locks"
252
- end
253
- ```
254
-
255
- ### MongoDB 4.2 Support
256
-
257
- In MongoDB 4.2, collections cannot be created within transactions.
258
- Therefore, you will need to manually run the following command once
259
- to initialize the lock collection:
260
-
261
- ```ruby
262
- Mongoid::Orderable::Models::Lock.create!
263
- ```
264
-
265
- This step is not necessary when using MongoDB 4.4+.
266
-
267
- ### Contributing
268
-
269
- Please fork the project on Github and raise a pull request including passing specs.
270
-
271
- ### Copyright & License
272
-
273
- Copyright (c) 2011 Arkadiy Zabazhanov, Johnny Shields, and contributors.
274
-
275
- MIT license, see [LICENSE](LICENSE.txt) for details.
1
+ [![Gem Version](https://badge.fury.io/rb/mongoid_orderable.svg)](https://badge.fury.io/rb/mongoid_orderable)
2
+ [![Test](https://github.com/mongoid/mongoid_orderable/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/mongoid/mongoid_orderable/actions/workflows/test.yml?query=branch%3Amaster)
3
+ [![Coverage Status](https://coveralls.io/repos/github/mongoid/mongoid_orderable/badge.svg?branch=master)](https://coveralls.io/github/mongoid/mongoid_orderable?branch=master)
4
+
5
+ # Mongoid Orderable
6
+
7
+ The Ruby 4.0 CI job measures all library files with SimpleCov and submits `coverage/.resultset.json` through the official Coveralls action using GitHub's automatic token. Other matrix jobs do not upload duplicate reports. Run `COVERAGE=true bundle install` and `COVERAGE=true bundle exec rake spec` to measure coverage locally. An accepted upstream default-branch build is required for the badge; this workflow alone does not activate the external service.
8
+
9
+ Mongoid::Orderable is a ordered list implementation for your Mongoid 7+ projects.
10
+
11
+ ### Core Features
12
+
13
+ * Sets a position index field on your documents which allows you to sort them in order.
14
+ * Uses MongoDB's `$inc` operator to batch-update position.
15
+ * Supports scope for position index, including changing scopes.
16
+ * Supports multiple position indexes on the same document.
17
+ * (Optional) Uses [MongoDB transactions](https://docs.mongodb.com/manual/core/transactions/) to ensure order integrity during concurrent updates.
18
+
19
+ ### Version Support
20
+
21
+ As of version 6.0.0, Mongoid::Orderable supports the following dependency versions:
22
+
23
+ * Ruby 2.6+
24
+ * Mongoid 7.0+
25
+ * Rails 5.2+
26
+
27
+ For older versions, please use Mongoid::Orderable 5.x and earlier.
28
+
29
+ Transaction support requires MongoDB 4.2+ (4.4+ recommended.)
30
+
31
+ ## Usage
32
+
33
+ See [UPGRADING](UPGRADING.md) for migration notes, including embedded position assignment changes in 6.0.7.
34
+
35
+ ### Getting Started
36
+
37
+ ```ruby
38
+ gem 'mongoid_orderable'
39
+ ```
40
+
41
+ Include `Mongoid::Orderable` into your model and call `orderable` method.
42
+ Embedded objects are automatically scoped to their parent.
43
+
44
+ ```ruby
45
+ class MyModel
46
+ include Mongoid::Document
47
+ include Mongoid::Orderable
48
+
49
+ belongs_to :group
50
+ belongs_to :drawer, class_name: "Office::Drawer",
51
+ foreign_key: "legacy_drawer_key_id"
52
+
53
+ orderable
54
+
55
+ # if you set :scope as a symbol, it will resolve the foreign key from relation
56
+ orderable scope: :drawer, field: :pos
57
+
58
+ # if you set :scope as a string, it will use it as the field name for scope
59
+ orderable scope: 'drawer', field: :pos
60
+
61
+ # scope can also be a proc
62
+ orderable scope: ->(doc) { where(group_id: doc.group_id) }
63
+
64
+ # this one if you want specify indexes manually
65
+ orderable index: false
66
+
67
+ # count position from zero as the top-most value (1 is the default value)
68
+ orderable base: 0
69
+ end
70
+ ```
71
+
72
+ You can also set default config values in an initializer, which will be
73
+ applied when calling the `orderable` macro in a model.
74
+
75
+ ```ruby
76
+ # configs/initializers/mongoid_orderable.rb
77
+ Mongoid::Orderable.configure do |config|
78
+ config.field = :pos
79
+ config.base = 0
80
+ config.index = false
81
+ end
82
+ ```
83
+
84
+ ### Moving Position
85
+
86
+ ```ruby
87
+ item.move_to 2 # just change position
88
+ item.move_to! 2 # and save
89
+ item.move_to = 2 # assignable method
90
+
91
+ # symbol position
92
+ item.move_to :top
93
+ item.move_to :bottom
94
+ item.move_to :higher
95
+ item.move_to :lower
96
+
97
+ # generated methods
98
+ item.move_to_top
99
+ item.move_to_bottom
100
+ item.move_higher
101
+ item.move_lower
102
+
103
+ item.next_items # return a collection of items higher on the list
104
+ item.previous_items # return a collection of items lower on the list
105
+
106
+ item.next_item # returns the next item in the list
107
+ item.previous_item # returns the previous item in the list
108
+ ```
109
+
110
+ ### Multiple Fields
111
+
112
+ You can also define multiple orderable fields for any class including the Mongoid::Orderable module.
113
+
114
+ ```ruby
115
+ class Book
116
+ include Mongoid::Document
117
+ include Mongoid::Orderable
118
+
119
+ orderable base: 0
120
+ orderable field: sno, as: :serial_no
121
+ end
122
+ ```
123
+
124
+ The above defines two different orderable_fields on Book - *position* and *serial_no*.
125
+ The following helpers are generated in this case:
126
+
127
+ ```ruby
128
+ book.move_#{field}_to
129
+ book.move_#{field}_to=
130
+ book.move_#{field}_to!
131
+
132
+ book.move_#{field}_to_top
133
+ book.move_#{field}_to_bottom
134
+ book.move_#{field}_higher
135
+ book.move_#{field}_lower
136
+
137
+ book.next_#{field}_items
138
+ book.previous_#{field}_items
139
+
140
+ book.next_#{field}_item
141
+ book.previous_#{field}_item
142
+ ```
143
+
144
+ where `#{field}` is either `position` or `serial_no`.
145
+
146
+ When a model defines multiple orderable fields, the original helpers are also available and work
147
+ on the first orderable field.
148
+
149
+ ```ruby
150
+ @book1 = Book.create!
151
+ @book2 = Book.create!
152
+ @book2 # => <Book _id: 53a16a2ba1bde4f746000001, serial_no: 1, position: 1>
153
+ @book2.move_to! :top # this will change the :position of the book to 0 (not serial_no)
154
+ @book2 # => <Book _id: 53a16a2ba1bde4f746000001, serial_no: 1, position: 0>
155
+ ```
156
+
157
+ To specify any other orderable field as default pass the **default: true** option with orderable.
158
+
159
+ ```ruby
160
+ orderable field: sno, as: :serial_no, default: true
161
+ ```
162
+
163
+ ### Embedded Documents
164
+
165
+ ```ruby
166
+ class Question
167
+ include Mongoid::Document
168
+ include Mongoid::Orderable
169
+
170
+ embedded_in :survey
171
+
172
+ orderable
173
+ end
174
+ ```
175
+
176
+ If you bulk import embedded documents without specifying their position,
177
+ no field `position` will be written.
178
+
179
+ ```ruby
180
+ class Survey
181
+ include Mongoid::Document
182
+
183
+ embeds_many :questions, cascade_callbacks: true
184
+ end
185
+ ```
186
+
187
+ To ensure the position is written correctly, you will need to set
188
+ `cascade_callbacks: true` on the relation.
189
+
190
+ Assigning an embedded document's position reorders its siblings when either the child or its parent is saved:
191
+
192
+ ```ruby
193
+ survey = Survey.create!
194
+ 3.times { survey.questions.create! }
195
+ question = survey.questions.last
196
+
197
+ question.position = 1
198
+ survey.save! # question.save! also works
199
+ survey.reload.questions.map(&:position) # => [2, 3, 1]
200
+ ```
201
+
202
+ Positions below the top or above the bottom are clamped to the list bounds. Assigning `nil` moves an existing child to the bottom. New children with a position are inserted at that position, shifting later siblings. Existing `move_to`, `move_to!`, and their helper methods remain supported; an explicit movement request takes precedence over a direct position assignment.
203
+
204
+ This changes the previous behavior where assigning an existing embedded child's position could leave duplicate positions instead of shifting its siblings. See [UPGRADING](UPGRADING.md).
205
+
206
+ ### Disable Ordering
207
+
208
+ You can disable position tracking for specific documents using the `:if` and `:unless` options.
209
+ This is in advanced scenarios where you want to control position manually for certain documents.
210
+ In general, the disable condition should match a specific scope.
211
+ **Warning:** If used improperly, this will cause your documents to become out-of-order.
212
+
213
+ ```ruby
214
+ class Book
215
+ include Mongoid::Document
216
+ include Mongoid::Orderable
217
+
218
+ field :track_position, type: Boolean
219
+
220
+ orderable if: :track_position, unless: -> { created_at < Date.parse('2020-01-01') }
221
+ end
222
+ ```
223
+
224
+ ## Transaction Support
225
+
226
+ By default, Mongoid Orderable does not guarantee ordering consistency
227
+ when doing multiple concurrent updates on documents. This means that
228
+ instead of having positions `1, 2, 3, 4, 5`, after running your system
229
+ in production at scale your position data will become corrupted, e.g.
230
+ `1, 1, 4, 4, 6`. To remedy this, this Mongoid Orderable can use
231
+ [MongoDB transactions](https://docs.mongodb.com/manual/core/transactions/)
232
+
233
+ ### Prerequisites
234
+
235
+ * MongoDB version 4.2+ (4.4+ recommended.)
236
+ * Requires [MongoDB Replica Set](https://docs.mongodb.com/manual/tutorial/deploy-replica-set/) topology
237
+
238
+ ### Configuration
239
+
240
+ You may enable transactions on both the global and model configs:
241
+
242
+ ```ruby
243
+ Mongoid::Orderable.configure do |config|
244
+ config.use_transactions = true # default: false
245
+ config.transaction_max_retries = 10 # default: 10
246
+ end
247
+
248
+ class MyModel
249
+ orderable :position, use_transactions: false
250
+ end
251
+ ```
252
+
253
+ When two transactions are attempted at the same time, database-level
254
+ `WriteConflict` failures may result and retries will be attempted.
255
+ After `transaction_max_retries` has been exceeded, a
256
+ `Mongoid::Orderable::Errors::TransactionFailed` error will be raised.
257
+
258
+ ### Locks
259
+
260
+ When using transactions, Mongoid Orderable creates a collection
261
+ `mongoid_orderable_locks` which is used to store temporary lock objects.
262
+ Lock collections use a TTL index which auto-deletes objects older than 1 day.
263
+
264
+ You can change the lock collection name globally or per model:
265
+
266
+ ```ruby
267
+ Mongoid::Orderable.configure do |config|
268
+ config.lock_collection = "my_locks" # default: "mongoid_orderable_locks"
269
+ end
270
+
271
+ class MyModel
272
+ orderable :position, lock_collection: "my_model_locks"
273
+ end
274
+ ```
275
+
276
+ ### MongoDB 4.2 Support
277
+
278
+ In MongoDB 4.2, collections cannot be created within transactions.
279
+ Therefore, you will need to manually run the following command once
280
+ to initialize the lock collection:
281
+
282
+ ```ruby
283
+ Mongoid::Orderable::Models::Lock.create!
284
+ ```
285
+
286
+ This step is not necessary when using MongoDB 4.4+.
287
+
288
+ ### Contributing
289
+
290
+ Please fork the project on Github and raise a pull request including passing specs.
291
+
292
+ ### Copyright & License
293
+
294
+ Copyright (c) 2011 Arkadiy Zabazhanov, Johnny Shields, and contributors.
295
+
296
+ MIT license, see [LICENSE](LICENSE.txt) for details.
data/Rakefile CHANGED
@@ -1,24 +1,24 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler'
4
-
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- warn e.message
9
- warn 'Run `bundle install` to install missing gems'
10
- exit e.status_code
11
- end
12
-
13
- Bundler::GemHelper.install_tasks
14
-
15
- require 'rspec/core'
16
- require 'rspec/core/rake_task'
17
- RSpec::Core::RakeTask.new(:spec) do |spec|
18
- spec.pattern = FileList['spec/**/*_spec.rb']
19
- end
20
-
21
- require 'rubocop/rake_task'
22
- RuboCop::RakeTask.new(:rubocop)
23
-
24
- task default: %i[rubocop spec]
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler'
4
+
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ warn e.message
9
+ warn 'Run `bundle install` to install missing gems'
10
+ exit e.status_code
11
+ end
12
+
13
+ Bundler::GemHelper.install_tasks
14
+
15
+ require 'rspec/core'
16
+ require 'rspec/core/rake_task'
17
+ RSpec::Core::RakeTask.new(:spec) do |spec|
18
+ spec.pattern = FileList['spec/**/*_spec.rb']
19
+ end
20
+
21
+ require 'rubocop/rake_task'
22
+ RuboCop::RakeTask.new(:rubocop)
23
+
24
+ task default: %i[rubocop spec]
@@ -1,12 +1,12 @@
1
- en:
2
- mongoid:
3
- errors:
4
- messages:
5
- invalid_target_position:
6
- message: "`%{value}` is not an acceptable value for target position."
7
- summary: "Mongoid::Orderable accepts: a Numeric, a numeric string, :top, :bottom, or nil."
8
- resolution: "You must give an acceptable value for target position."
9
- transaction_failed:
10
- message: "Transaction failed due to a database-level conflict."
11
- summary: ""
12
- resolution: "Please retry the transaction."
1
+ en:
2
+ mongoid:
3
+ errors:
4
+ messages:
5
+ invalid_target_position:
6
+ message: "`%{value}` is not an acceptable value for target position."
7
+ summary: "Mongoid::Orderable accepts: a Numeric, a numeric string, :top, :bottom, or nil."
8
+ resolution: "You must give an acceptable value for target position."
9
+ transaction_failed:
10
+ message: "Transaction failed due to a database-level conflict."
11
+ summary: ""
12
+ resolution: "Please retry the transaction."