mongoid_i18n_rails 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 9a0d2aeb52549db406f5db13383d78b42c2561f6
4
+ data.tar.gz: aa4ab1e8ea94347587150238553188e654d1a86f
5
+ SHA512:
6
+ metadata.gz: 77ac7de5e5d14879f39c62f8b99bcec229dc4bcfeaaac86de8f27c90803978d519116ffb9242bf3e53e250f02b7cf129d53a0b8ee3faa2788198a51626b5c786
7
+ data.tar.gz: 3710eede7825bbb916dc517d3d18c6250c9babdcf9cd3b88cb31328f099af7f5e9371547c32184cfd6420c78a49033d491adaea565578058675d5ae92bb78773
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 YOURNAME
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.
data/README.rdoc ADDED
@@ -0,0 +1,3 @@
1
+ = MongoidI18n
2
+
3
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'MongoidI18n'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
@@ -0,0 +1,3 @@
1
+ module MongoidI18nRails
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ module MongoidI18nRails
2
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :mongoid_i18n do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,469 @@
1
+ en:
2
+ mongoid:
3
+ errors:
4
+ messages:
5
+ blank_in_locale:
6
+ "can't be blank in %{location}"
7
+ ambiguous_relationship:
8
+ message: "Ambiguous relations %{candidates} defined on %{klass}."
9
+ summary:
10
+ "When Mongoid attempts to set an inverse document of a relation
11
+ in memory, it needs to know which relation it belongs to. When
12
+ setting %{name}, Mongoid looked on the class %{inverse}
13
+ for a matching relation, but multiples were found that could
14
+ potentially match: %{candidates}."
15
+ resolution: "On the %{name} relation on %{inverse} you must add an
16
+ :inverse_of option to specify the exact relationship on %{klass}
17
+ that is the opposite of %{name}."
18
+ callbacks:
19
+ message: "Calling %{method} on %{klass} resulted in a false return
20
+ from a callback."
21
+ summary: "If a before callback returns false when using Document.create!,
22
+ Document#save!, or Documnet#update_attributes! this error will get raised
23
+ since the document did not actually get saved."
24
+ resolution: "Double check all before callbacks to make sure they are
25
+ not unintentionally returning false."
26
+ calling_document_find_with_nil_is_invalid:
27
+ message: "Calling Document.find with nil is invalid."
28
+ summary: "Document.find expects the parameters to be 1 or more ids, and
29
+ will return a single document if 1 id is provided, otherwise an array
30
+ of documents if multiple ids are provided."
31
+ resolution: "Most likely this is caused by passing parameters directly
32
+ through to the find, and the parameter either is not present or the
33
+ key from which it is accessed is incorrect."
34
+ document_not_destroyed:
35
+ message: "%{klass} with id %{id} was not destroyed."
36
+ summary: "When calling %{klass}#destroy! and a callback halts the destroy
37
+ callback chain by returning a false value, the deletion will not
38
+ actually occur."
39
+ resolution: "Check the before/after destroy callbacks to ensure that the
40
+ return values are truthy for the chain to continue."
41
+ document_not_found:
42
+ message: "Document(s) not found for class %{klass} with id(s) %{missing}."
43
+ summary: "When calling %{klass}.find with an id or array of ids, each
44
+ parameter must match a document in the database or this error will be
45
+ raised. The search was for the id(s): %{searched} (%{total} total)
46
+ and the following ids were not found: %{missing}."
47
+ resolution: "Search for an id that is in the database or set
48
+ the Mongoid.raise_not_found_error configuration option to false,
49
+ which will cause a nil to be returned instead of raising this error when
50
+ searching for a single id, or only the matched documents when searching
51
+ for multiples."
52
+ document_with_attributes_not_found:
53
+ message: "Document not found for class %{klass} with attributes %{attributes}."
54
+ summary: "When calling %{klass}.find_by with a hash of attributes, all
55
+ attributes provided must match a document in the database or this error
56
+ will be raised."
57
+ resolution: "Search for attributes that are in the database or set
58
+ the Mongoid.raise_not_found_error configuration option to false,
59
+ which will cause a nil to be returned instead of raising this error."
60
+ eager_load:
61
+ message: "Eager loading :%{name} is not supported since it is a
62
+ polymorphic belongs_to relation."
63
+ summary: "Mongoid cannot currently determine the classes it needs to
64
+ eager load when the relation is polymorphic. The parents reside in
65
+ different collections so a simple id lookup is not sufficient enough."
66
+ resolution: "Don't attempt to perform this action and have patience,
67
+ maybe this will be supported in the future."
68
+ invalid_collection:
69
+ message: "Access to the collection for %{klass} is not allowed."
70
+ summary: "%{klass}.collection was called, and %{klass} is an embedded
71
+ document - it resides within the collection of the root document of
72
+ the hierarchy."
73
+ resolution: "For access to the collection that the embedded document is
74
+ in, use %{klass}#_root.collection, or do not attempt to persist an
75
+ embedded document without a parent set."
76
+ invalid_config_option:
77
+ message: "Invalid configuration option: %{name}."
78
+ summary: "A invalid configuration option was provided in your
79
+ mongoid.yml, or a typo is potentially present. The valid configuration
80
+ options are: %{options}."
81
+ resolution: "Remove the invalid option or fix the typo. If you were
82
+ expecting the option to be there, please consult the following page
83
+ with repect to Mongoid's configuration:\n\n
84
+ \_\_http://mongoid.org/en/mongoid/docs/installation.html"
85
+ invalid_field:
86
+ message: "Defining a field named '%{name}' is not allowed."
87
+ summary: "Defining this field would override the method '%{name}',
88
+ which would cause issues with expectations around the original
89
+ method and cause extremely hard to debug issues. The original
90
+ method was defined in:\n
91
+ \_\_Object: %{origin}\n
92
+ \_\_File: %{file}\n
93
+ \_\_Line: %{line}"
94
+ resolution: "Use Mongoid.destructive_fields to see what names are not
95
+ allowed, and don't use these names. These include names that also
96
+ conflict with core Ruby methods on Object, Module, Enumerable, or
97
+ included gems that inject methods into these or Mongoid internals."
98
+ invalid_field_option:
99
+ message: "Invalid option :%{option} provided for field :%{name}."
100
+ summary: "Mongoid requires that you only provide valid options on each
101
+ field definition in order to prevent unexpected behaviour later on."
102
+ resolution: "When defining the field :%{name} on '%{klass}', please provide
103
+ valid options for the field. These are currently: %{valid}. If you
104
+ meant to define a custom field option, please do so first like so:\n\n
105
+ \_\_Mongoid::Fields.option :%{option} do |model, field, value|\n
106
+ \_\_\_\_# Your logic here...\n
107
+ \_\_end\n
108
+ \_\_class %{klass}\n
109
+ \_\_\_\_include Mongoid::Document\n
110
+ \_\_\_\_field :%{name}, %{option}: true\n
111
+ \_\_end\n\n"
112
+ invalid_includes:
113
+ message: "Invalid includes directive: %{klass}.includes(%{args})"
114
+ summary: "Eager loading in Mongoid only supports providing arguments
115
+ to %{klass}.includes that are the names of relations on the %{klass}
116
+ model, and only supports one level of eager loading. (ie, eager loading
117
+ associations not on the %{klass} but one step away via another relation
118
+ is not allowed."
119
+ resolution: "Ensure that each parameter passed to %{klass}.includes is
120
+ a valid name of a relation on the %{klass} model. These are: %{relations}."
121
+ invalid_index:
122
+ message: "Invalid index specification on %{klass}: %{spec}, %{options}"
123
+ summary: "Indexes in Mongoid are defined as a hash of field name and
124
+ direction/2d pairs, with a hash for any additional options."
125
+ resolution: "Ensure that the index conforms to the correct syntax and
126
+ has the correct options.\n\n
127
+ Valid options are:\n
128
+ \_\_background: true|false\n
129
+ \_\_database: 'database_name'\n
130
+ \_\_drop_dups: true|false\n
131
+ \_\_name: 'index_name'\n
132
+ \_\_sparse: true|false\n
133
+ \_\_unique: true|false\n
134
+ \_\_min: 1\n
135
+ \_\_max: 1\n
136
+ \_\_bits: 26\n
137
+ \_\_bucket_size : 1\n
138
+ \_\_weights: { content: 1, title: 2 }\n
139
+ \_\_expire_after_seconds: number_of_seconds\n
140
+ Valid types are: 1, -1, '2d', '2dsphere', 'geoHaystack', 'text', 'hashed'\n\n
141
+ Example:\n
142
+ \_\_class Band\n
143
+ \_\_\_\_include Mongoid::Document\n
144
+ \_\_\_\_index({ name: 1, label: -1 }, { sparse: true })\n
145
+ \_\_\_\_index({ location: '2d' }, { background: true })\n
146
+ \_\_end\n\n"
147
+ invalid_options:
148
+ message: "Invalid option :%{invalid} provided to relation :%{name}."
149
+ summary: "Mongoid checks the options that are passed to the relation
150
+ macros to ensure that no ill side effects occur by letting something
151
+ slip by."
152
+ resolution: "Valid options are: %{valid}, make sure these are the ones
153
+ you are using."
154
+ invalid_path:
155
+ message: "Having a root path assigned for %{klass} is invalid."
156
+ summary: "Mongoid has two different path objects for determining
157
+ the location of a document in the database, Root and Embedded.
158
+ This error is raised when an embedded document somehow gets a
159
+ root path assigned."
160
+ resolution: "Most likely your embedded model, %{klass} is also
161
+ referenced via a has_many from a root document in another
162
+ collection. Double check the relation definitions and fix any
163
+ instances where embedded documents are improperly referenced
164
+ from other collections."
165
+ invalid_scope:
166
+ message: "Defining a scope of value %{value} on %{klass} is not
167
+ allowed."
168
+ summary: "Scopes in Mongoid must be procs that wrap criteria objects."
169
+ resolution: "Change the scope to be a proc wrapped critera.\n\n
170
+ Example:\n
171
+ \_\_class Band\n
172
+ \_\_\_\_include Mongoid::Document\n
173
+ \_\_\_\_scope :inactive, ->{ where(active: false) }\n
174
+ \_\_end\n\n"
175
+ invalid_storage_options:
176
+ message: "Invalid options passed to %{klass}.store_in: %{options}."
177
+ summary: "The :store_in macro takes only a hash of parameters with
178
+ the keys :database, :collection, or :session."
179
+ resolution: "Change the options passed to store_in to match the
180
+ documented API, and ensure all keys in the options hash are
181
+ symbols.\n\n
182
+ Example:\n
183
+ \_\_class Band\n
184
+ \_\_\_\_include Mongoid::Document\n
185
+ \_\_\_\_store_in collection: 'artists', database: 'secondary'\n
186
+ \_\_end\n\n"
187
+ invalid_storage_parent:
188
+ message: "Invalid store_in call on class %{klass}."
189
+ summary: "The :store_in macro can only be called on a base Mongoid Document"
190
+ resolution: "Remove the store_in call on class %{klass}, as it will use its
191
+ parent store configuration. Or remove the hierarchy extension for this
192
+ class."
193
+ invalid_time:
194
+ message: "'%{value}' is not a valid Time."
195
+ summary: "Mongoid tries to serialize the values for Date, DateTime, and
196
+ Time into proper UTC times to store in the database. The provided
197
+ value could not be parsed."
198
+ resolution: "Make sure to pass parsable values to the field setter
199
+ for Date, DateTime, and Time objects. When this is a String it needs
200
+ to be valid for Time.parse. Other objects must be valid to pass to
201
+ Time.local."
202
+ inverse_not_found:
203
+ message: "When adding a(n) %{klass} to %{base}#%{name}, Mongoid could
204
+ not determine the inverse foreign key to set. The attempted key was
205
+ '%{inverse}'."
206
+ summary: "When adding a document to a relation, Mongoid attempts
207
+ to link the newly added document to the base of the relation in
208
+ memory, as well as set the foreign key to link them on the
209
+ database side. In this case Mongoid could not determine what the
210
+ inverse foreign key was."
211
+ resolution: "If an inverse is not required, like a belongs_to or
212
+ has_and_belongs_to_many, ensure that :inverse_of => nil is set
213
+ on the relation. If the inverse is needed, most likely the
214
+ inverse cannot be figured out from the names of the relations and
215
+ you will need to explicitly tell Mongoid on the relation what
216
+ the inverse is.\n\n
217
+ Example:\n
218
+ \_\_class Lush\n
219
+ \_\_\_\_include Mongoid::Document\n
220
+ \_\_\_\_has_one :whiskey, class_name: \"Drink\", inverse_of: :alcoholic\n
221
+ \_\_end\n\n
222
+ \_\_class Drink\n
223
+ \_\_\_\_include Mongoid::Document\n
224
+ \_\_\_\_belongs_to :alcoholic, class_name: \"Lush\", inverse_of: :whiskey\n
225
+ \_\_end"
226
+ invalid_set_polymorphic_relation:
227
+ message: "The %{name} attribute can't be set to an instance of
228
+ %{other_klass} as %{other_klass} has multiple relations referencing
229
+ %{klass} as %{name}."
230
+ summary: "If the parent class of a polymorphic relation has multiple
231
+ definitions for the same relation, the values must be set from the
232
+ parent side and not the child side since Mongoid cannot determine
233
+ from the child side which relation to go in."
234
+ resolution: "Set the values from the parent, or redefine the relation
235
+ with only a single definition in the parent."
236
+ invalid_value:
237
+ message: "Value of type %{value_class} cannot be written to a field of type %{field_class}"
238
+ summary: "Tried to set a value of type %{value_class} to a field of type %{field_class}"
239
+ resolution: "Verify if the value to be set correspond to field definition"
240
+ mixed_relations:
241
+ message: "Referencing a(n) %{embedded} document from the %{root}
242
+ document via a relational association is not allowed since the
243
+ %{embedded} is embedded."
244
+ summary: "In order to properly access a(n) %{embedded} from %{root}
245
+ the reference would need to go through the root document of
246
+ %{embedded}. In a simple case this would require Mongoid to store
247
+ an extra foreign key for the root, in more complex cases where
248
+ %{embedded} is multiple levels deep a key would need to be stored
249
+ for each parent up the hierarchy."
250
+ resolution: "Consider not embedding %{embedded}, or do the key
251
+ storage and access in a custom manner in the application code."
252
+ mixed_session_configuration:
253
+ message: "Both uri and standard configuration options defined for
254
+ session: '%{name}'."
255
+ summary: "Instead of simply giving uri or standard options a
256
+ preference order, Mongoid assumes that you have made a mistake in
257
+ your configuration and requires that you provide one or the other,
258
+ but not both. The options that were provided were: %{config}."
259
+ resolution: "Provide either only a uri as configuration or only
260
+ standard options."
261
+ nested_attributes_metadata_not_found:
262
+ message: "Could not find metadata for relation '%{name}' on model:
263
+ %{klass}."
264
+ summary: "When defining nested attributes for a relation, Mongoid
265
+ needs to access the metadata for the relation '%{name}' in order
266
+ if add autosave functionality to it, if applicable. Either no
267
+ relation named '%{name}' could be found, or the relation had not
268
+ been defined yet."
269
+ resolution: "Make sure that there is a relation defined named
270
+ '%{name}' on %{klass} or that the relation definition comes before
271
+ the accepts_nested_attributes_for macro in the model - order
272
+ matters so that Mongoid has access to the metadata.\n\n
273
+ Example:\n
274
+ \_\_class Band\n
275
+ \_\_\_\_include Mongoid::Document\n
276
+ \_\_\_\_has_many :albums\n
277
+ \_\_\_\_accepts_nested_attributes_for :albums\n
278
+ \_\_end\n\n"
279
+ no_default_session:
280
+ message: "No default session configuration is defined."
281
+ summary: "The configuration provided settings for: %{keys}, but
282
+ Mongoid requires a :default to be defined at minimum."
283
+ resolution: "If configuring via a mongoid.yml, ensure that within
284
+ your :sessions section a :default session is defined.\n\n
285
+ Example:\n
286
+ \_\_development:\n
287
+ \_\_\_\_sessions:\n
288
+ \_\_\_\_\_\_default:\n
289
+ \_\_\_\_\_\_\_\_hosts:\n
290
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
291
+ no_environment:
292
+ message: "Could not load the configuration since no environment
293
+ was defined."
294
+ summary: "Mongoid attempted to find the appropriate environment
295
+ but no Rails.env, Sinatra::Base.environment, RACK_ENV, or
296
+ MONGOID_ENV could be found."
297
+ resolution: "Make sure some environment is set from the mentioned
298
+ options. Mongoid cannot load configuration from the yaml without
299
+ knowing which environment it is in, and we have considered
300
+ defaulting to development an undesireable side effect of this not
301
+ being defined."
302
+ no_map_reduce_output:
303
+ message: "No output location was specified for the map/reduce
304
+ operation."
305
+ summary: "When executing a map/reduce, you must provide the output
306
+ location of the results. The attempted command was: %{command}."
307
+ resolution: "Provide the location that the output of the operation
308
+ is to go by chaining an #out call to the map/reduce.\n\n
309
+ Example:\n
310
+ \_\_Band.map_reduce(map, reduce).out(inline: 1)\n\n
311
+ Valid options for the out function are:\n
312
+ \_\_inline: 1\n
313
+ \_\_merge: 'collection-name'\n
314
+ \_\_replace: 'collection-name'\n
315
+ \_\_reduce: 'collection-name'\n\n"
316
+ no_metadata:
317
+ message: "Metadata not found for document of type %{klass}."
318
+ summary: "Mongoid sets the metadata of a relation on the document
319
+ when it is either loaded from within the relation, or added to
320
+ one. The presence of the metadata is required in order to
321
+ provide various functionality around relations. Most likely you
322
+ are getting this error because the document is embedded and was
323
+ attempted to be persisted without being associated with a parent,
324
+ or the relation was not properly defined."
325
+ resolution: "Ensure that your relations on the %{klass} model
326
+ are all properly defined, and that the inverse relations
327
+ are also properly defined. Embedded relations must have both the
328
+ parent (embeds_one/embeds_many) and the inverse (embedded_in)
329
+ present in order to work properly."
330
+ no_parent:
331
+ message: "Cannot persist embedded document %{klass} without a
332
+ parent document."
333
+ summary: "If the document is embedded, in order to be persisted it
334
+ must always have a reference to its parent document. This is
335
+ most likely caused by either calling %{klass}.create or
336
+ %{klass}.create! without setting the parent document as an
337
+ attribute."
338
+ resolution: "Ensure that you've set the parent relation if
339
+ instantiating the embedded document directly, or always create new
340
+ embedded documents via the parent relation."
341
+ no_session_config:
342
+ message: "No configuration could be found for a session named
343
+ '%{name}'."
344
+ summary: "When attempting to create the new session, Mongoid could
345
+ not find a session configuration for the name: '%{name}'. This is
346
+ necessary in order to know the host, port, and options needed
347
+ to connect."
348
+ resolution: "Double check your mongoid.yml to make sure under the
349
+ sessions key that a configuration exists for '%{name}'. If you
350
+ have set the configuration programatically, ensure that '%{name}'
351
+ exists in the configuration hash."
352
+ no_sessions_config:
353
+ message: "No sessions configuration provided."
354
+ summary: "Mongoid's configuration requires that you provide details
355
+ about each session that can be connected to, and requires in
356
+ the sessions config at least 1 default session to exist."
357
+ resolution: "Double check your mongoid.yml to make sure that you
358
+ have a top-level sessions key with at least 1 default session
359
+ configuration for it. You can regenerate a new mongoid.yml for
360
+ assistance via `rails g mongoid:config`.\n\n
361
+ Example:\n
362
+ \_\_development:\n
363
+ \_\_\_\_sessions:\n
364
+ \_\_\_\_\_\_default:\n
365
+ \_\_\_\_\_\_\_\_database: mongoid_dev\n
366
+ \_\_\_\_\_\_\_\_hosts:\n
367
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
368
+ no_session_database:
369
+ message: "No database provided for session configuration: :%{name}."
370
+ summary: "Each session configuration must provide a database so Mongoid
371
+ knows where the default database to persist to. What was provided
372
+ was: %{config}."
373
+ resolution: "If configuring via a mongoid.yml, ensure that within
374
+ your :%{name} section a :database value for the session's default
375
+ database is defined.\n\n
376
+ Example:\n
377
+ \_\_development:\n
378
+ \_\_\_\_sessions:\n
379
+ \_\_\_\_\_\_%{name}:\n
380
+ \_\_\_\_\_\_\_\_database: my_app_db\n
381
+ \_\_\_\_\_\_\_\_hosts:\n
382
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
383
+ no_session_hosts:
384
+ message: "No hosts provided for session configuration: :%{name}."
385
+ summary: "Each session configuration must provide hosts so Mongoid
386
+ knows where the database server is located. What was provided
387
+ was: %{config}."
388
+ resolution: "If configuring via a mongoid.yml, ensure that within
389
+ your :%{name} section a :hosts value for the session hosts is
390
+ defined.\n\n
391
+ Example:\n
392
+ \_\_development:\n
393
+ \_\_\_\_sessions:\n
394
+ \_\_\_\_\_\_%{name}:\n
395
+ \_\_\_\_\_\_\_\_database: my_app_db\n
396
+ \_\_\_\_\_\_\_\_hosts:\n
397
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
398
+ readonly_attribute:
399
+ message: "Attempted to set the readonly attribute '%{name}' with
400
+ the value: %{value}."
401
+ summary: "Attributes flagged as readonly via Model.attr_readonly
402
+ can only have values set when the document is a new record."
403
+ resolution: "Don't define '%{name}' as readonly, or do not attempt
404
+ to update its value after the document is persisted."
405
+ readonly_document:
406
+ message: "Attempted to persist the readonly document '%{klass}'."
407
+ summary: "Documents loaded from the database using #only
408
+ cannot be persisted."
409
+ resolution: "Don't attempt to persist documents that are flagged as
410
+ readonly."
411
+ scope_overwrite:
412
+ message: "Cannot create scope :%{scope_name}, because of existing
413
+ method %{model_name}.%{scope_name}."
414
+ summary: "When defining a scope that conflicts with a method that
415
+ already exists on the model, this error will get raised if
416
+ Mongoid.scope_overwrite_exception is set to true."
417
+ resolution: "Change the name of the scope so it does not conflict
418
+ with the already defined method %{model_name}, or set the
419
+ configuration option Mongoid.scope_overwrite_exception to false,
420
+ which is its default. In this case a warning will be logged."
421
+ taken:
422
+ "is already taken"
423
+ too_many_nested_attribute_records:
424
+ message: "Accepting nested attributes for %{association} is limited
425
+ to %{limit} records."
426
+ summary: "More documents were sent to be processed than the allowed
427
+ limit."
428
+ resolution: "The limit is set as an option to the macro, for example:
429
+ accepts_nested_attributes_for :%{association}, limit: %{limit}.
430
+ Consider raising this limit or making sure no more are sent than
431
+ the set value."
432
+ unknown_attribute:
433
+ message: "Attempted to set a value for '%{name}' which is not
434
+ allowed on the model %{klass}."
435
+ summary: "Without including Mongoid::Attributes::Dynamic in your model
436
+ and the attribute does not already exist in the attributes hash,
437
+ attempting to call %{klass}#%{name}= for it is not allowed. This is
438
+ also triggered by passing the attribute to any method that accepts an
439
+ attributes hash, and is raised instead of getting a NoMethodError."
440
+ resolution: "You can include Mongoid::Attributes::Dynamic if you
441
+ expect to be writing values for undefined fields often."
442
+ unsaved_document:
443
+ message: "Attempted to save %{document} before the parent %{base}."
444
+ summary: "You cannot call create or create! through the
445
+ relation (%{document}) who's parent (%{base}) is
446
+ not already saved. This would case the database to be out of sync
447
+ since the child could potentially reference a nonexistant parent."
448
+ resolution: "Make sure to only use create or create! when the parent
449
+ document %{base} is persisted."
450
+ unsupported_javascript:
451
+ message: "Executing Javascript $where selector on an embedded criteria
452
+ is not supported."
453
+ summary: "Mongoid only supports providing a hash of arguments to
454
+ #where criterion on embedded documents. Since %{klass} is embedded,
455
+ the expression %{javascript} is not allowed."
456
+ resolution: "Please provide a standard hash to #where when the criteria
457
+ is for an embedded relation."
458
+ validations:
459
+ message: "Validation of %{document} failed."
460
+ summary: "The following errors were found: %{errors}"
461
+ resolution: "Try persisting the document with valid data or remove
462
+ the validations."
463
+ delete_restriction:
464
+ message: "Cannot delete %{document} because of dependent '%{relation}'."
465
+ summary: "When defining '%{relation}' with a :dependent => :restrict,
466
+ Mongoid will raise an error when attempting to delete the
467
+ %{document} when the child '%{relation}' still has documents in it."
468
+ resolution: "Don't attempt to delete the parent %{document} when
469
+ it has children, or change the dependent option on the relation."
@@ -0,0 +1,469 @@
1
+ pt-BR:
2
+ mongoid:
3
+ errors:
4
+ messages:
5
+ blank_in_locale:
6
+ "can't be blank in %{location}"
7
+ ambiguous_relationship:
8
+ message: "Ambiguous relations %{candidates} defined on %{klass}."
9
+ summary:
10
+ "When Mongoid attempts to set an inverse document of a relation
11
+ in memory, it needs to know which relation it belongs to. When
12
+ setting %{name}, Mongoid looked on the class %{inverse}
13
+ for a matching relation, but multiples were found that could
14
+ potentially match: %{candidates}."
15
+ resolution: "On the %{name} relation on %{inverse} you must add an
16
+ :inverse_of option to specify the exact relationship on %{klass}
17
+ that is the opposite of %{name}."
18
+ callbacks:
19
+ message: "Calling %{method} on %{klass} resulted in a false return
20
+ from a callback."
21
+ summary: "If a before callback returns false when using Document.create!,
22
+ Document#save!, or Documnet#update_attributes! this error will get raised
23
+ since the document did not actually get saved."
24
+ resolution: "Double check all before callbacks to make sure they are
25
+ not unintentionally returning false."
26
+ calling_document_find_with_nil_is_invalid:
27
+ message: "Calling Document.find with nil is invalid."
28
+ summary: "Document.find expects the parameters to be 1 or more ids, and
29
+ will return a single document if 1 id is provided, otherwise an array
30
+ of documents if multiple ids are provided."
31
+ resolution: "Most likely this is caused by passing parameters directly
32
+ through to the find, and the parameter either is not present or the
33
+ key from which it is accessed is incorrect."
34
+ document_not_destroyed:
35
+ message: "%{klass} with id %{id} was not destroyed."
36
+ summary: "When calling %{klass}#destroy! and a callback halts the destroy
37
+ callback chain by returning a false value, the deletion will not
38
+ actually occur."
39
+ resolution: "Check the before/after destroy callbacks to ensure that the
40
+ return values are truthy for the chain to continue."
41
+ document_not_found:
42
+ message: "Não foi possível encontrar %{klass} com id(s) %{missing}."
43
+ summary: "When calling %{klass}.find with an id or array of ids, each
44
+ parameter must match a document in the database or this error will be
45
+ raised. The search was for the id(s): %{searched} (%{total} total)
46
+ and the following ids were not found: %{missing}."
47
+ resolution: "Search for an id that is in the database or set
48
+ the Mongoid.raise_not_found_error configuration option to false,
49
+ which will cause a nil to be returned instead of raising this error when
50
+ searching for a single id, or only the matched documents when searching
51
+ for multiples."
52
+ document_with_attributes_not_found:
53
+ message: "Document not found for class %{klass} with attributes %{attributes}."
54
+ summary: "When calling %{klass}.find_by with a hash of attributes, all
55
+ attributes provided must match a document in the database or this error
56
+ will be raised."
57
+ resolution: "Search for attributes that are in the database or set
58
+ the Mongoid.raise_not_found_error configuration option to false,
59
+ which will cause a nil to be returned instead of raising this error."
60
+ eager_load:
61
+ message: "Eager loading :%{name} is not supported since it is a
62
+ polymorphic belongs_to relation."
63
+ summary: "Mongoid cannot currently determine the classes it needs to
64
+ eager load when the relation is polymorphic. The parents reside in
65
+ different collections so a simple id lookup is not sufficient enough."
66
+ resolution: "Don't attempt to perform this action and have patience,
67
+ maybe this will be supported in the future."
68
+ invalid_collection:
69
+ message: "Access to the collection for %{klass} is not allowed."
70
+ summary: "%{klass}.collection was called, and %{klass} is an embedded
71
+ document - it resides within the collection of the root document of
72
+ the hierarchy."
73
+ resolution: "For access to the collection that the embedded document is
74
+ in, use %{klass}#_root.collection, or do not attempt to persist an
75
+ embedded document without a parent set."
76
+ invalid_config_option:
77
+ message: "Invalid configuration option: %{name}."
78
+ summary: "A invalid configuration option was provided in your
79
+ mongoid.yml, or a typo is potentially present. The valid configuration
80
+ options are: %{options}."
81
+ resolution: "Remove the invalid option or fix the typo. If you were
82
+ expecting the option to be there, please consult the following page
83
+ with repect to Mongoid's configuration:\n\n
84
+ \_\_http://mongoid.org/en/mongoid/docs/installation.html"
85
+ invalid_field:
86
+ message: "Defining a field named '%{name}' is not allowed."
87
+ summary: "Defining this field would override the method '%{name}',
88
+ which would cause issues with expectations around the original
89
+ method and cause extremely hard to debug issues. The original
90
+ method was defined in:\n
91
+ \_\_Object: %{origin}\n
92
+ \_\_File: %{file}\n
93
+ \_\_Line: %{line}"
94
+ resolution: "Use Mongoid.destructive_fields to see what names are not
95
+ allowed, and don't use these names. These include names that also
96
+ conflict with core Ruby methods on Object, Module, Enumerable, or
97
+ included gems that inject methods into these or Mongoid internals."
98
+ invalid_field_option:
99
+ message: "Invalid option :%{option} provided for field :%{name}."
100
+ summary: "Mongoid requires that you only provide valid options on each
101
+ field definition in order to prevent unexpected behaviour later on."
102
+ resolution: "When defining the field :%{name} on '%{klass}', please provide
103
+ valid options for the field. These are currently: %{valid}. If you
104
+ meant to define a custom field option, please do so first like so:\n\n
105
+ \_\_Mongoid::Fields.option :%{option} do |model, field, value|\n
106
+ \_\_\_\_# Your logic here...\n
107
+ \_\_end\n
108
+ \_\_class %{klass}\n
109
+ \_\_\_\_include Mongoid::Document\n
110
+ \_\_\_\_field :%{name}, %{option}: true\n
111
+ \_\_end\n\n"
112
+ invalid_includes:
113
+ message: "Invalid includes directive: %{klass}.includes(%{args})"
114
+ summary: "Eager loading in Mongoid only supports providing arguments
115
+ to %{klass}.includes that are the names of relations on the %{klass}
116
+ model, and only supports one level of eager loading. (ie, eager loading
117
+ associations not on the %{klass} but one step away via another relation
118
+ is not allowed."
119
+ resolution: "Ensure that each parameter passed to %{klass}.includes is
120
+ a valid name of a relation on the %{klass} model. These are: %{relations}."
121
+ invalid_index:
122
+ message: "Invalid index specification on %{klass}: %{spec}, %{options}"
123
+ summary: "Indexes in Mongoid are defined as a hash of field name and
124
+ direction/2d pairs, with a hash for any additional options."
125
+ resolution: "Ensure that the index conforms to the correct syntax and
126
+ has the correct options.\n\n
127
+ Valid options are:\n
128
+ \_\_background: true|false\n
129
+ \_\_database: 'database_name'\n
130
+ \_\_drop_dups: true|false\n
131
+ \_\_name: 'index_name'\n
132
+ \_\_sparse: true|false\n
133
+ \_\_unique: true|false\n
134
+ \_\_min: 1\n
135
+ \_\_max: 1\n
136
+ \_\_bits: 26\n
137
+ \_\_bucket_size : 1\n
138
+ \_\_weights: { content: 1, title: 2 }\n
139
+ \_\_expire_after_seconds: number_of_seconds\n
140
+ Valid types are: 1, -1, '2d', '2dsphere', 'geoHaystack', 'text', 'hashed'\n\n
141
+ Example:\n
142
+ \_\_class Band\n
143
+ \_\_\_\_include Mongoid::Document\n
144
+ \_\_\_\_index({ name: 1, label: -1 }, { sparse: true })\n
145
+ \_\_\_\_index({ location: '2d' }, { background: true })\n
146
+ \_\_end\n\n"
147
+ invalid_options:
148
+ message: "Invalid option :%{invalid} provided to relation :%{name}."
149
+ summary: "Mongoid checks the options that are passed to the relation
150
+ macros to ensure that no ill side effects occur by letting something
151
+ slip by."
152
+ resolution: "Valid options are: %{valid}, make sure these are the ones
153
+ you are using."
154
+ invalid_path:
155
+ message: "Having a root path assigned for %{klass} is invalid."
156
+ summary: "Mongoid has two different path objects for determining
157
+ the location of a document in the database, Root and Embedded.
158
+ This error is raised when an embedded document somehow gets a
159
+ root path assigned."
160
+ resolution: "Most likely your embedded model, %{klass} is also
161
+ referenced via a has_many from a root document in another
162
+ collection. Double check the relation definitions and fix any
163
+ instances where embedded documents are improperly referenced
164
+ from other collections."
165
+ invalid_scope:
166
+ message: "Defining a scope of value %{value} on %{klass} is not
167
+ allowed."
168
+ summary: "Scopes in Mongoid must be procs that wrap criteria objects."
169
+ resolution: "Change the scope to be a proc wrapped critera.\n\n
170
+ Example:\n
171
+ \_\_class Band\n
172
+ \_\_\_\_include Mongoid::Document\n
173
+ \_\_\_\_scope :inactive, ->{ where(active: false) }\n
174
+ \_\_end\n\n"
175
+ invalid_storage_options:
176
+ message: "Invalid options passed to %{klass}.store_in: %{options}."
177
+ summary: "The :store_in macro takes only a hash of parameters with
178
+ the keys :database, :collection, or :session."
179
+ resolution: "Change the options passed to store_in to match the
180
+ documented API, and ensure all keys in the options hash are
181
+ symbols.\n\n
182
+ Example:\n
183
+ \_\_class Band\n
184
+ \_\_\_\_include Mongoid::Document\n
185
+ \_\_\_\_store_in collection: 'artists', database: 'secondary'\n
186
+ \_\_end\n\n"
187
+ invalid_storage_parent:
188
+ message: "Invalid store_in call on class %{klass}."
189
+ summary: "The :store_in macro can only be called on a base Mongoid Document"
190
+ resolution: "Remove the store_in call on class %{klass}, as it will use its
191
+ parent store configuration. Or remove the hierarchy extension for this
192
+ class."
193
+ invalid_time:
194
+ message: "'%{value}' is not a valid Time."
195
+ summary: "Mongoid tries to serialize the values for Date, DateTime, and
196
+ Time into proper UTC times to store in the database. The provided
197
+ value could not be parsed."
198
+ resolution: "Make sure to pass parsable values to the field setter
199
+ for Date, DateTime, and Time objects. When this is a String it needs
200
+ to be valid for Time.parse. Other objects must be valid to pass to
201
+ Time.local."
202
+ inverse_not_found:
203
+ message: "When adding a(n) %{klass} to %{base}#%{name}, Mongoid could
204
+ not determine the inverse foreign key to set. The attempted key was
205
+ '%{inverse}'."
206
+ summary: "When adding a document to a relation, Mongoid attempts
207
+ to link the newly added document to the base of the relation in
208
+ memory, as well as set the foreign key to link them on the
209
+ database side. In this case Mongoid could not determine what the
210
+ inverse foreign key was."
211
+ resolution: "If an inverse is not required, like a belongs_to or
212
+ has_and_belongs_to_many, ensure that :inverse_of => nil is set
213
+ on the relation. If the inverse is needed, most likely the
214
+ inverse cannot be figured out from the names of the relations and
215
+ you will need to explicitly tell Mongoid on the relation what
216
+ the inverse is.\n\n
217
+ Example:\n
218
+ \_\_class Lush\n
219
+ \_\_\_\_include Mongoid::Document\n
220
+ \_\_\_\_has_one :whiskey, class_name: \"Drink\", inverse_of: :alcoholic\n
221
+ \_\_end\n\n
222
+ \_\_class Drink\n
223
+ \_\_\_\_include Mongoid::Document\n
224
+ \_\_\_\_belongs_to :alcoholic, class_name: \"Lush\", inverse_of: :whiskey\n
225
+ \_\_end"
226
+ invalid_set_polymorphic_relation:
227
+ message: "The %{name} attribute can't be set to an instance of
228
+ %{other_klass} as %{other_klass} has multiple relations referencing
229
+ %{klass} as %{name}."
230
+ summary: "If the parent class of a polymorphic relation has multiple
231
+ definitions for the same relation, the values must be set from the
232
+ parent side and not the child side since Mongoid cannot determine
233
+ from the child side which relation to go in."
234
+ resolution: "Set the values from the parent, or redefine the relation
235
+ with only a single definition in the parent."
236
+ invalid_value:
237
+ message: "Value of type %{value_class} cannot be written to a field of type %{field_class}"
238
+ summary: "Tried to set a value of type %{value_class} to a field of type %{field_class}"
239
+ resolution: "Verify if the value to be set correspond to field definition"
240
+ mixed_relations:
241
+ message: "Referencing a(n) %{embedded} document from the %{root}
242
+ document via a relational association is not allowed since the
243
+ %{embedded} is embedded."
244
+ summary: "In order to properly access a(n) %{embedded} from %{root}
245
+ the reference would need to go through the root document of
246
+ %{embedded}. In a simple case this would require Mongoid to store
247
+ an extra foreign key for the root, in more complex cases where
248
+ %{embedded} is multiple levels deep a key would need to be stored
249
+ for each parent up the hierarchy."
250
+ resolution: "Consider not embedding %{embedded}, or do the key
251
+ storage and access in a custom manner in the application code."
252
+ mixed_session_configuration:
253
+ message: "Both uri and standard configuration options defined for
254
+ session: '%{name}'."
255
+ summary: "Instead of simply giving uri or standard options a
256
+ preference order, Mongoid assumes that you have made a mistake in
257
+ your configuration and requires that you provide one or the other,
258
+ but not both. The options that were provided were: %{config}."
259
+ resolution: "Provide either only a uri as configuration or only
260
+ standard options."
261
+ nested_attributes_metadata_not_found:
262
+ message: "Could not find metadata for relation '%{name}' on model:
263
+ %{klass}."
264
+ summary: "When defining nested attributes for a relation, Mongoid
265
+ needs to access the metadata for the relation '%{name}' in order
266
+ if add autosave functionality to it, if applicable. Either no
267
+ relation named '%{name}' could be found, or the relation had not
268
+ been defined yet."
269
+ resolution: "Make sure that there is a relation defined named
270
+ '%{name}' on %{klass} or that the relation definition comes before
271
+ the accepts_nested_attributes_for macro in the model - order
272
+ matters so that Mongoid has access to the metadata.\n\n
273
+ Example:\n
274
+ \_\_class Band\n
275
+ \_\_\_\_include Mongoid::Document\n
276
+ \_\_\_\_has_many :albums\n
277
+ \_\_\_\_accepts_nested_attributes_for :albums\n
278
+ \_\_end\n\n"
279
+ no_default_session:
280
+ message: "No default session configuration is defined."
281
+ summary: "The configuration provided settings for: %{keys}, but
282
+ Mongoid requires a :default to be defined at minimum."
283
+ resolution: "If configuring via a mongoid.yml, ensure that within
284
+ your :sessions section a :default session is defined.\n\n
285
+ Example:\n
286
+ \_\_development:\n
287
+ \_\_\_\_sessions:\n
288
+ \_\_\_\_\_\_default:\n
289
+ \_\_\_\_\_\_\_\_hosts:\n
290
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
291
+ no_environment:
292
+ message: "Could not load the configuration since no environment
293
+ was defined."
294
+ summary: "Mongoid attempted to find the appropriate environment
295
+ but no Rails.env, Sinatra::Base.environment, RACK_ENV, or
296
+ MONGOID_ENV could be found."
297
+ resolution: "Make sure some environment is set from the mentioned
298
+ options. Mongoid cannot load configuration from the yaml without
299
+ knowing which environment it is in, and we have considered
300
+ defaulting to development an undesireable side effect of this not
301
+ being defined."
302
+ no_map_reduce_output:
303
+ message: "No output location was specified for the map/reduce
304
+ operation."
305
+ summary: "When executing a map/reduce, you must provide the output
306
+ location of the results. The attempted command was: %{command}."
307
+ resolution: "Provide the location that the output of the operation
308
+ is to go by chaining an #out call to the map/reduce.\n\n
309
+ Example:\n
310
+ \_\_Band.map_reduce(map, reduce).out(inline: 1)\n\n
311
+ Valid options for the out function are:\n
312
+ \_\_inline: 1\n
313
+ \_\_merge: 'collection-name'\n
314
+ \_\_replace: 'collection-name'\n
315
+ \_\_reduce: 'collection-name'\n\n"
316
+ no_metadata:
317
+ message: "Metadata not found for document of type %{klass}."
318
+ summary: "Mongoid sets the metadata of a relation on the document
319
+ when it is either loaded from within the relation, or added to
320
+ one. The presence of the metadata is required in order to
321
+ provide various functionality around relations. Most likely you
322
+ are getting this error because the document is embedded and was
323
+ attempted to be persisted without being associated with a parent,
324
+ or the relation was not properly defined."
325
+ resolution: "Ensure that your relations on the %{klass} model
326
+ are all properly defined, and that the inverse relations
327
+ are also properly defined. Embedded relations must have both the
328
+ parent (embeds_one/embeds_many) and the inverse (embedded_in)
329
+ present in order to work properly."
330
+ no_parent:
331
+ message: "Cannot persist embedded document %{klass} without a
332
+ parent document."
333
+ summary: "If the document is embedded, in order to be persisted it
334
+ must always have a reference to its parent document. This is
335
+ most likely caused by either calling %{klass}.create or
336
+ %{klass}.create! without setting the parent document as an
337
+ attribute."
338
+ resolution: "Ensure that you've set the parent relation if
339
+ instantiating the embedded document directly, or always create new
340
+ embedded documents via the parent relation."
341
+ no_session_config:
342
+ message: "No configuration could be found for a session named
343
+ '%{name}'."
344
+ summary: "When attempting to create the new session, Mongoid could
345
+ not find a session configuration for the name: '%{name}'. This is
346
+ necessary in order to know the host, port, and options needed
347
+ to connect."
348
+ resolution: "Double check your mongoid.yml to make sure under the
349
+ sessions key that a configuration exists for '%{name}'. If you
350
+ have set the configuration programatically, ensure that '%{name}'
351
+ exists in the configuration hash."
352
+ no_sessions_config:
353
+ message: "No sessions configuration provided."
354
+ summary: "Mongoid's configuration requires that you provide details
355
+ about each session that can be connected to, and requires in
356
+ the sessions config at least 1 default session to exist."
357
+ resolution: "Double check your mongoid.yml to make sure that you
358
+ have a top-level sessions key with at least 1 default session
359
+ configuration for it. You can regenerate a new mongoid.yml for
360
+ assistance via `rails g mongoid:config`.\n\n
361
+ Example:\n
362
+ \_\_development:\n
363
+ \_\_\_\_sessions:\n
364
+ \_\_\_\_\_\_default:\n
365
+ \_\_\_\_\_\_\_\_database: mongoid_dev\n
366
+ \_\_\_\_\_\_\_\_hosts:\n
367
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
368
+ no_session_database:
369
+ message: "No database provided for session configuration: :%{name}."
370
+ summary: "Each session configuration must provide a database so Mongoid
371
+ knows where the default database to persist to. What was provided
372
+ was: %{config}."
373
+ resolution: "If configuring via a mongoid.yml, ensure that within
374
+ your :%{name} section a :database value for the session's default
375
+ database is defined.\n\n
376
+ Example:\n
377
+ \_\_development:\n
378
+ \_\_\_\_sessions:\n
379
+ \_\_\_\_\_\_%{name}:\n
380
+ \_\_\_\_\_\_\_\_database: my_app_db\n
381
+ \_\_\_\_\_\_\_\_hosts:\n
382
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
383
+ no_session_hosts:
384
+ message: "No hosts provided for session configuration: :%{name}."
385
+ summary: "Each session configuration must provide hosts so Mongoid
386
+ knows where the database server is located. What was provided
387
+ was: %{config}."
388
+ resolution: "If configuring via a mongoid.yml, ensure that within
389
+ your :%{name} section a :hosts value for the session hosts is
390
+ defined.\n\n
391
+ Example:\n
392
+ \_\_development:\n
393
+ \_\_\_\_sessions:\n
394
+ \_\_\_\_\_\_%{name}:\n
395
+ \_\_\_\_\_\_\_\_database: my_app_db\n
396
+ \_\_\_\_\_\_\_\_hosts:\n
397
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
398
+ readonly_attribute:
399
+ message: "Attempted to set the readonly attribute '%{name}' with
400
+ the value: %{value}."
401
+ summary: "Attributes flagged as readonly via Model.attr_readonly
402
+ can only have values set when the document is a new record."
403
+ resolution: "Don't define '%{name}' as readonly, or do not attempt
404
+ to update its value after the document is persisted."
405
+ readonly_document:
406
+ message: "Attempted to persist the readonly document '%{klass}'."
407
+ summary: "Documents loaded from the database using #only
408
+ cannot be persisted."
409
+ resolution: "Don't attempt to persist documents that are flagged as
410
+ readonly."
411
+ scope_overwrite:
412
+ message: "Cannot create scope :%{scope_name}, because of existing
413
+ method %{model_name}.%{scope_name}."
414
+ summary: "When defining a scope that conflicts with a method that
415
+ already exists on the model, this error will get raised if
416
+ Mongoid.scope_overwrite_exception is set to true."
417
+ resolution: "Change the name of the scope so it does not conflict
418
+ with the already defined method %{model_name}, or set the
419
+ configuration option Mongoid.scope_overwrite_exception to false,
420
+ which is its default. In this case a warning will be logged."
421
+ taken:
422
+ "is already taken"
423
+ too_many_nested_attribute_records:
424
+ message: "Accepting nested attributes for %{association} is limited
425
+ to %{limit} records."
426
+ summary: "More documents were sent to be processed than the allowed
427
+ limit."
428
+ resolution: "The limit is set as an option to the macro, for example:
429
+ accepts_nested_attributes_for :%{association}, limit: %{limit}.
430
+ Consider raising this limit or making sure no more are sent than
431
+ the set value."
432
+ unknown_attribute:
433
+ message: "Attempted to set a value for '%{name}' which is not
434
+ allowed on the model %{klass}."
435
+ summary: "Without including Mongoid::Attributes::Dynamic in your model
436
+ and the attribute does not already exist in the attributes hash,
437
+ attempting to call %{klass}#%{name}= for it is not allowed. This is
438
+ also triggered by passing the attribute to any method that accepts an
439
+ attributes hash, and is raised instead of getting a NoMethodError."
440
+ resolution: "You can include Mongoid::Attributes::Dynamic if you
441
+ expect to be writing values for undefined fields often."
442
+ unsaved_document:
443
+ message: "Attempted to save %{document} before the parent %{base}."
444
+ summary: "You cannot call create or create! through the
445
+ relation (%{document}) who's parent (%{base}) is
446
+ not already saved. This would case the database to be out of sync
447
+ since the child could potentially reference a nonexistant parent."
448
+ resolution: "Make sure to only use create or create! when the parent
449
+ document %{base} is persisted."
450
+ unsupported_javascript:
451
+ message: "Executing Javascript $where selector on an embedded criteria
452
+ is not supported."
453
+ summary: "Mongoid only supports providing a hash of arguments to
454
+ #where criterion on embedded documents. Since %{klass} is embedded,
455
+ the expression %{javascript} is not allowed."
456
+ resolution: "Please provide a standard hash to #where when the criteria
457
+ is for an embedded relation."
458
+ validations:
459
+ message: "Validation of %{document} failed."
460
+ summary: "The following errors were found: %{errors}"
461
+ resolution: "Try persisting the document with valid data or remove
462
+ the validations."
463
+ delete_restriction:
464
+ message: "Cannot delete %{document} because of dependent '%{relation}'."
465
+ summary: "When defining '%{relation}' with a :dependent => :restrict,
466
+ Mongoid will raise an error when attempting to delete the
467
+ %{document} when the child '%{relation}' still has documents in it."
468
+ resolution: "Don't attempt to delete the parent %{document} when
469
+ it has children, or change the dependent option on the relation."
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mongoid_i18n_rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Leandro Moreira
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.1'
27
+ description: Provides i18n for mongoid 4 for Rails 4.
28
+ email:
29
+ - leandro.ribeiro.moreira@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.rdoc
36
+ - Rakefile
37
+ - lib/mongoid_i18n_rails.rb
38
+ - lib/mongoid_i18n_rails/version.rb
39
+ - lib/tasks/mongoid_i18n_rails_tasks.rake
40
+ - rails/locale/mongoid-en.yml
41
+ - rails/locale/mongoid-pt-BR.yml
42
+ homepage: https://github.com/leandromoreira/mongoid-i18n
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.2.2
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Provide i18n for mongoid 4
66
+ test_files: []