mongoid-multi-db 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +615 -0
- data/LICENSE +20 -0
- data/README.md +62 -0
- data/Rakefile +49 -0
- data/lib/config/locales/bg.yml +54 -0
- data/lib/config/locales/de.yml +54 -0
- data/lib/config/locales/en-GB.yml +55 -0
- data/lib/config/locales/en.yml +55 -0
- data/lib/config/locales/es.yml +52 -0
- data/lib/config/locales/fr.yml +55 -0
- data/lib/config/locales/hi.yml +46 -0
- data/lib/config/locales/hu.yml +57 -0
- data/lib/config/locales/id.yml +55 -0
- data/lib/config/locales/it.yml +52 -0
- data/lib/config/locales/ja.yml +50 -0
- data/lib/config/locales/kr.yml +47 -0
- data/lib/config/locales/nl.yml +52 -0
- data/lib/config/locales/pl.yml +52 -0
- data/lib/config/locales/pt-BR.yml +53 -0
- data/lib/config/locales/pt.yml +53 -0
- data/lib/config/locales/ro.yml +59 -0
- data/lib/config/locales/ru.yml +54 -0
- data/lib/config/locales/sv.yml +53 -0
- data/lib/config/locales/vi.yml +55 -0
- data/lib/config/locales/zh-CN.yml +46 -0
- data/lib/mongoid.rb +148 -0
- data/lib/mongoid/atomic.rb +230 -0
- data/lib/mongoid/atomic/modifiers.rb +243 -0
- data/lib/mongoid/atomic/paths.rb +3 -0
- data/lib/mongoid/atomic/paths/embedded.rb +43 -0
- data/lib/mongoid/atomic/paths/embedded/many.rb +44 -0
- data/lib/mongoid/atomic/paths/embedded/one.rb +43 -0
- data/lib/mongoid/atomic/paths/root.rb +40 -0
- data/lib/mongoid/attributes.rb +234 -0
- data/lib/mongoid/attributes/processing.rb +146 -0
- data/lib/mongoid/callbacks.rb +135 -0
- data/lib/mongoid/collection.rb +153 -0
- data/lib/mongoid/collection_proxy.rb +59 -0
- data/lib/mongoid/collections.rb +120 -0
- data/lib/mongoid/collections/master.rb +45 -0
- data/lib/mongoid/collections/operations.rb +44 -0
- data/lib/mongoid/collections/retry.rb +46 -0
- data/lib/mongoid/components.rb +96 -0
- data/lib/mongoid/config.rb +347 -0
- data/lib/mongoid/config/database.rb +186 -0
- data/lib/mongoid/config/replset_database.rb +82 -0
- data/lib/mongoid/connection_proxy.rb +30 -0
- data/lib/mongoid/contexts.rb +25 -0
- data/lib/mongoid/contexts/enumerable.rb +288 -0
- data/lib/mongoid/contexts/enumerable/sort.rb +43 -0
- data/lib/mongoid/contexts/mongo.rb +409 -0
- data/lib/mongoid/copyable.rb +48 -0
- data/lib/mongoid/criteria.rb +418 -0
- data/lib/mongoid/criterion/builder.rb +34 -0
- data/lib/mongoid/criterion/complex.rb +84 -0
- data/lib/mongoid/criterion/creational.rb +34 -0
- data/lib/mongoid/criterion/exclusion.rb +108 -0
- data/lib/mongoid/criterion/inclusion.rb +305 -0
- data/lib/mongoid/criterion/inspection.rb +22 -0
- data/lib/mongoid/criterion/optional.rb +232 -0
- data/lib/mongoid/criterion/selector.rb +153 -0
- data/lib/mongoid/cursor.rb +86 -0
- data/lib/mongoid/database_proxy.rb +97 -0
- data/lib/mongoid/default_scope.rb +36 -0
- data/lib/mongoid/dirty.rb +110 -0
- data/lib/mongoid/document.rb +280 -0
- data/lib/mongoid/errors.rb +17 -0
- data/lib/mongoid/errors/callback.rb +26 -0
- data/lib/mongoid/errors/document_not_found.rb +28 -0
- data/lib/mongoid/errors/eager_load.rb +25 -0
- data/lib/mongoid/errors/invalid_collection.rb +18 -0
- data/lib/mongoid/errors/invalid_database.rb +19 -0
- data/lib/mongoid/errors/invalid_field.rb +18 -0
- data/lib/mongoid/errors/invalid_find.rb +19 -0
- data/lib/mongoid/errors/invalid_options.rb +28 -0
- data/lib/mongoid/errors/invalid_time.rb +25 -0
- data/lib/mongoid/errors/invalid_type.rb +25 -0
- data/lib/mongoid/errors/mixed_relations.rb +37 -0
- data/lib/mongoid/errors/mongoid_error.rb +26 -0
- data/lib/mongoid/errors/too_many_nested_attribute_records.rb +20 -0
- data/lib/mongoid/errors/unsaved_document.rb +23 -0
- data/lib/mongoid/errors/unsupported_version.rb +20 -0
- data/lib/mongoid/errors/validations.rb +23 -0
- data/lib/mongoid/extensions.rb +82 -0
- data/lib/mongoid/extensions/array/deletion.rb +29 -0
- data/lib/mongoid/extensions/false_class/equality.rb +26 -0
- data/lib/mongoid/extensions/hash/criteria_helpers.rb +45 -0
- data/lib/mongoid/extensions/hash/scoping.rb +25 -0
- data/lib/mongoid/extensions/integer/checks.rb +23 -0
- data/lib/mongoid/extensions/nil/collectionization.rb +23 -0
- data/lib/mongoid/extensions/object/checks.rb +29 -0
- data/lib/mongoid/extensions/object/reflections.rb +48 -0
- data/lib/mongoid/extensions/object/substitutable.rb +15 -0
- data/lib/mongoid/extensions/object/yoda.rb +44 -0
- data/lib/mongoid/extensions/object_id/conversions.rb +60 -0
- data/lib/mongoid/extensions/proc/scoping.rb +25 -0
- data/lib/mongoid/extensions/string/checks.rb +36 -0
- data/lib/mongoid/extensions/string/conversions.rb +22 -0
- data/lib/mongoid/extensions/string/inflections.rb +118 -0
- data/lib/mongoid/extensions/symbol/checks.rb +23 -0
- data/lib/mongoid/extensions/symbol/inflections.rb +66 -0
- data/lib/mongoid/extensions/true_class/equality.rb +26 -0
- data/lib/mongoid/extras.rb +31 -0
- data/lib/mongoid/factory.rb +46 -0
- data/lib/mongoid/fields.rb +332 -0
- data/lib/mongoid/fields/mappings.rb +41 -0
- data/lib/mongoid/fields/serializable.rb +201 -0
- data/lib/mongoid/fields/serializable/array.rb +49 -0
- data/lib/mongoid/fields/serializable/big_decimal.rb +42 -0
- data/lib/mongoid/fields/serializable/bignum.rb +10 -0
- data/lib/mongoid/fields/serializable/binary.rb +11 -0
- data/lib/mongoid/fields/serializable/boolean.rb +43 -0
- data/lib/mongoid/fields/serializable/date.rb +51 -0
- data/lib/mongoid/fields/serializable/date_time.rb +28 -0
- data/lib/mongoid/fields/serializable/fixnum.rb +10 -0
- data/lib/mongoid/fields/serializable/float.rb +32 -0
- data/lib/mongoid/fields/serializable/foreign_keys/array.rb +42 -0
- data/lib/mongoid/fields/serializable/foreign_keys/object.rb +47 -0
- data/lib/mongoid/fields/serializable/hash.rb +11 -0
- data/lib/mongoid/fields/serializable/integer.rb +44 -0
- data/lib/mongoid/fields/serializable/localized.rb +41 -0
- data/lib/mongoid/fields/serializable/nil_class.rb +38 -0
- data/lib/mongoid/fields/serializable/object.rb +11 -0
- data/lib/mongoid/fields/serializable/object_id.rb +31 -0
- data/lib/mongoid/fields/serializable/range.rb +42 -0
- data/lib/mongoid/fields/serializable/set.rb +42 -0
- data/lib/mongoid/fields/serializable/string.rb +27 -0
- data/lib/mongoid/fields/serializable/symbol.rb +27 -0
- data/lib/mongoid/fields/serializable/time.rb +23 -0
- data/lib/mongoid/fields/serializable/time_with_zone.rb +23 -0
- data/lib/mongoid/fields/serializable/timekeeping.rb +106 -0
- data/lib/mongoid/finders.rb +152 -0
- data/lib/mongoid/hierarchy.rb +120 -0
- data/lib/mongoid/identity.rb +92 -0
- data/lib/mongoid/identity_map.rb +119 -0
- data/lib/mongoid/indexes.rb +54 -0
- data/lib/mongoid/inspection.rb +54 -0
- data/lib/mongoid/javascript.rb +20 -0
- data/lib/mongoid/javascript/functions.yml +63 -0
- data/lib/mongoid/json.rb +16 -0
- data/lib/mongoid/keys.rb +144 -0
- data/lib/mongoid/logger.rb +39 -0
- data/lib/mongoid/matchers.rb +32 -0
- data/lib/mongoid/matchers/all.rb +21 -0
- data/lib/mongoid/matchers/and.rb +30 -0
- data/lib/mongoid/matchers/default.rb +70 -0
- data/lib/mongoid/matchers/exists.rb +23 -0
- data/lib/mongoid/matchers/gt.rb +21 -0
- data/lib/mongoid/matchers/gte.rb +21 -0
- data/lib/mongoid/matchers/in.rb +21 -0
- data/lib/mongoid/matchers/lt.rb +21 -0
- data/lib/mongoid/matchers/lte.rb +21 -0
- data/lib/mongoid/matchers/ne.rb +21 -0
- data/lib/mongoid/matchers/nin.rb +21 -0
- data/lib/mongoid/matchers/or.rb +33 -0
- data/lib/mongoid/matchers/size.rb +21 -0
- data/lib/mongoid/matchers/strategies.rb +93 -0
- data/lib/mongoid/multi_database.rb +31 -0
- data/lib/mongoid/multi_parameter_attributes.rb +106 -0
- data/lib/mongoid/named_scope.rb +146 -0
- data/lib/mongoid/nested_attributes.rb +54 -0
- data/lib/mongoid/observer.rb +170 -0
- data/lib/mongoid/paranoia.rb +158 -0
- data/lib/mongoid/persistence.rb +264 -0
- data/lib/mongoid/persistence/atomic.rb +223 -0
- data/lib/mongoid/persistence/atomic/add_to_set.rb +35 -0
- data/lib/mongoid/persistence/atomic/bit.rb +37 -0
- data/lib/mongoid/persistence/atomic/inc.rb +31 -0
- data/lib/mongoid/persistence/atomic/operation.rb +85 -0
- data/lib/mongoid/persistence/atomic/pop.rb +34 -0
- data/lib/mongoid/persistence/atomic/pull.rb +34 -0
- data/lib/mongoid/persistence/atomic/pull_all.rb +34 -0
- data/lib/mongoid/persistence/atomic/push.rb +31 -0
- data/lib/mongoid/persistence/atomic/push_all.rb +31 -0
- data/lib/mongoid/persistence/atomic/rename.rb +31 -0
- data/lib/mongoid/persistence/atomic/sets.rb +30 -0
- data/lib/mongoid/persistence/atomic/unset.rb +28 -0
- data/lib/mongoid/persistence/deletion.rb +32 -0
- data/lib/mongoid/persistence/insertion.rb +41 -0
- data/lib/mongoid/persistence/modification.rb +37 -0
- data/lib/mongoid/persistence/operations.rb +211 -0
- data/lib/mongoid/persistence/operations/embedded/insert.rb +42 -0
- data/lib/mongoid/persistence/operations/embedded/remove.rb +40 -0
- data/lib/mongoid/persistence/operations/insert.rb +34 -0
- data/lib/mongoid/persistence/operations/remove.rb +33 -0
- data/lib/mongoid/persistence/operations/update.rb +64 -0
- data/lib/mongoid/railtie.rb +126 -0
- data/lib/mongoid/railties/database.rake +182 -0
- data/lib/mongoid/railties/document.rb +12 -0
- data/lib/mongoid/relations.rb +144 -0
- data/lib/mongoid/relations/accessors.rb +138 -0
- data/lib/mongoid/relations/auto_save.rb +38 -0
- data/lib/mongoid/relations/binding.rb +26 -0
- data/lib/mongoid/relations/bindings.rb +9 -0
- data/lib/mongoid/relations/bindings/embedded/in.rb +69 -0
- data/lib/mongoid/relations/bindings/embedded/many.rb +93 -0
- data/lib/mongoid/relations/bindings/embedded/one.rb +61 -0
- data/lib/mongoid/relations/bindings/referenced/in.rb +76 -0
- data/lib/mongoid/relations/bindings/referenced/many.rb +54 -0
- data/lib/mongoid/relations/bindings/referenced/many_to_many.rb +51 -0
- data/lib/mongoid/relations/bindings/referenced/one.rb +58 -0
- data/lib/mongoid/relations/builder.rb +57 -0
- data/lib/mongoid/relations/builders.rb +83 -0
- data/lib/mongoid/relations/builders/embedded/in.rb +29 -0
- data/lib/mongoid/relations/builders/embedded/many.rb +40 -0
- data/lib/mongoid/relations/builders/embedded/one.rb +30 -0
- data/lib/mongoid/relations/builders/nested_attributes/many.rb +110 -0
- data/lib/mongoid/relations/builders/nested_attributes/one.rb +135 -0
- data/lib/mongoid/relations/builders/referenced/in.rb +26 -0
- data/lib/mongoid/relations/builders/referenced/many.rb +27 -0
- data/lib/mongoid/relations/builders/referenced/many_to_many.rb +38 -0
- data/lib/mongoid/relations/builders/referenced/one.rb +26 -0
- data/lib/mongoid/relations/cascading.rb +56 -0
- data/lib/mongoid/relations/cascading/delete.rb +19 -0
- data/lib/mongoid/relations/cascading/destroy.rb +26 -0
- data/lib/mongoid/relations/cascading/nullify.rb +18 -0
- data/lib/mongoid/relations/cascading/strategy.rb +26 -0
- data/lib/mongoid/relations/constraint.rb +42 -0
- data/lib/mongoid/relations/conversions.rb +35 -0
- data/lib/mongoid/relations/cyclic.rb +103 -0
- data/lib/mongoid/relations/embedded/atomic.rb +89 -0
- data/lib/mongoid/relations/embedded/atomic/operation.rb +63 -0
- data/lib/mongoid/relations/embedded/atomic/pull.rb +65 -0
- data/lib/mongoid/relations/embedded/atomic/push_all.rb +59 -0
- data/lib/mongoid/relations/embedded/atomic/set.rb +61 -0
- data/lib/mongoid/relations/embedded/atomic/unset.rb +41 -0
- data/lib/mongoid/relations/embedded/in.rb +220 -0
- data/lib/mongoid/relations/embedded/many.rb +560 -0
- data/lib/mongoid/relations/embedded/one.rb +206 -0
- data/lib/mongoid/relations/embedded/sort.rb +31 -0
- data/lib/mongoid/relations/macros.rb +310 -0
- data/lib/mongoid/relations/many.rb +135 -0
- data/lib/mongoid/relations/metadata.rb +919 -0
- data/lib/mongoid/relations/nested_builder.rb +75 -0
- data/lib/mongoid/relations/one.rb +36 -0
- data/lib/mongoid/relations/options.rb +47 -0
- data/lib/mongoid/relations/polymorphic.rb +40 -0
- data/lib/mongoid/relations/proxy.rb +145 -0
- data/lib/mongoid/relations/referenced/batch.rb +72 -0
- data/lib/mongoid/relations/referenced/batch/insert.rb +57 -0
- data/lib/mongoid/relations/referenced/in.rb +262 -0
- data/lib/mongoid/relations/referenced/many.rb +623 -0
- data/lib/mongoid/relations/referenced/many_to_many.rb +396 -0
- data/lib/mongoid/relations/referenced/one.rb +272 -0
- data/lib/mongoid/relations/reflections.rb +62 -0
- data/lib/mongoid/relations/synchronization.rb +153 -0
- data/lib/mongoid/relations/targets.rb +2 -0
- data/lib/mongoid/relations/targets/enumerable.rb +372 -0
- data/lib/mongoid/reloading.rb +91 -0
- data/lib/mongoid/safety.rb +105 -0
- data/lib/mongoid/scope.rb +31 -0
- data/lib/mongoid/serialization.rb +134 -0
- data/lib/mongoid/sharding.rb +61 -0
- data/lib/mongoid/state.rb +97 -0
- data/lib/mongoid/threaded.rb +530 -0
- data/lib/mongoid/threaded/lifecycle.rb +192 -0
- data/lib/mongoid/timestamps.rb +15 -0
- data/lib/mongoid/timestamps/created.rb +24 -0
- data/lib/mongoid/timestamps/timeless.rb +50 -0
- data/lib/mongoid/timestamps/updated.rb +26 -0
- data/lib/mongoid/validations.rb +140 -0
- data/lib/mongoid/validations/associated.rb +46 -0
- data/lib/mongoid/validations/uniqueness.rb +145 -0
- data/lib/mongoid/version.rb +4 -0
- data/lib/mongoid/versioning.rb +185 -0
- data/lib/rack/mongoid.rb +2 -0
- data/lib/rack/mongoid/middleware/identity_map.rb +38 -0
- data/lib/rails/generators/mongoid/config/config_generator.rb +25 -0
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +20 -0
- data/lib/rails/generators/mongoid/model/model_generator.rb +24 -0
- data/lib/rails/generators/mongoid/model/templates/model.rb.tt +19 -0
- data/lib/rails/generators/mongoid/observer/observer_generator.rb +17 -0
- data/lib/rails/generators/mongoid/observer/templates/observer.rb.tt +4 -0
- data/lib/rails/generators/mongoid_generator.rb +70 -0
- data/lib/rails/mongoid.rb +91 -0
- metadata +465 -0
@@ -0,0 +1,53 @@
|
|
1
|
+
pt:
|
2
|
+
mongoid:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
taken:
|
6
|
+
já está utilizada
|
7
|
+
callbacks:
|
8
|
+
"Calling %{method} on %{klass} resulted in a false return from a callback."
|
9
|
+
document_not_found:
|
10
|
+
Nenhum documento encontrado para a classe %{klass} com os id(s) %{identifiers}.
|
11
|
+
eager_load:
|
12
|
+
"Eager loading :%{name} is not supported due to it being a many-to-many
|
13
|
+
or polymorphic belongs_to relation."
|
14
|
+
invalid_database:
|
15
|
+
A base de dados deverá ser uma Mongo::DB, em vez de %{name}.
|
16
|
+
invalid_time:
|
17
|
+
"'%{value}' is not a valid Time."
|
18
|
+
invalid_type:
|
19
|
+
O campo foi definido como %{klass}, mas recebeu uma instância de %{other} com
|
20
|
+
o valor %{value}.
|
21
|
+
invalid_options:
|
22
|
+
"Invalid option :%{invalid} provided to relation :%{name}. Valid options
|
23
|
+
are: %{valid}."
|
24
|
+
unsupported_version:
|
25
|
+
MongoDB %{version} não é suportada, por favor actualize para a
|
26
|
+
versão %{mongo_version}.
|
27
|
+
validations:
|
28
|
+
A validação falhou - %{errors}.
|
29
|
+
invalid_collection:
|
30
|
+
O acesso à colecção para %{klass} não é permitido porque
|
31
|
+
é um documento embebido, por favor aceda à colecção através
|
32
|
+
do documento raiz.
|
33
|
+
invalid_field:
|
34
|
+
Não é permitido definir um campo com o nome %{name}. Não defina
|
35
|
+
campos que entrem em conflito com os nomes dos atributos internos e métodos
|
36
|
+
do Mongoid. Use Document#instance_methods para consultar esses nomes.
|
37
|
+
too_many_nested_attribute_records:
|
38
|
+
A aceitação de atributos encadeados para %{association} encontra-se limitada
|
39
|
+
a %{limit} registros.
|
40
|
+
embedded_in_must_have_inverse_of:
|
41
|
+
As opções para uma associação embedded_in devem incluir inverse_of.
|
42
|
+
dependent_only_references_one_or_many:
|
43
|
+
A opção The dependent => destroy|delete que é fornecida
|
44
|
+
é apenas válida para associações references_one ou references_many.
|
45
|
+
association_cant_have_inverse_of:
|
46
|
+
A definição de inverse_of nesta associação não é permitida. Apenas
|
47
|
+
use esta opção em embedded_in ou references_many como lista.
|
48
|
+
unsaved_document:
|
49
|
+
You cannot call create or create! through a relational association
|
50
|
+
relation (%{document}) who's parent (%{base}) is not already saved.
|
51
|
+
mixed_relations:
|
52
|
+
Referencing a(n) %{embedded} document from the %{root} document via a
|
53
|
+
relational association is not allowed since the %{embedded} is embedded.
|
@@ -0,0 +1,59 @@
|
|
1
|
+
ro:
|
2
|
+
mongoid:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
taken:
|
6
|
+
este deja folosit
|
7
|
+
callbacks:
|
8
|
+
"Calling %{method} on %{klass} resulted in a false return from a callback."
|
9
|
+
document_not_found:
|
10
|
+
Nu există document în clasa %{klass} cu id %{identifiers}.
|
11
|
+
eager_load:
|
12
|
+
"Eager loading :%{name} is not supported due to it being a many-to-many
|
13
|
+
or polymorphic belongs_to relation."
|
14
|
+
invalid_database:
|
15
|
+
Baza de date ar trebui să fie de tipul Mongo::DB, nu %{name}.
|
16
|
+
invalid_time:
|
17
|
+
"'%{value}' is not a valid Time."
|
18
|
+
invalid_type:
|
19
|
+
Câmpul a fost definit ca şi un(o) %{klass}, dar valoarea
|
20
|
+
recepţionată %{value} este de clasa %{other}.
|
21
|
+
invalid_options:
|
22
|
+
"Invalid option :%{invalid} provided to relation :%{name}. Valid options
|
23
|
+
are: %{valid}."
|
24
|
+
unsupported_version:
|
25
|
+
Versiunea MongoDB %{version} nu este suportată.
|
26
|
+
Vă rugăm să folosiţi versiunea %{mongo_version}.
|
27
|
+
validations:
|
28
|
+
Validare nereuşită - %{errors}.
|
29
|
+
invalid_collection:
|
30
|
+
Accesul la colecţie din clasa %{klass} este interzisă, fiindcă
|
31
|
+
este un document încorporat. Vă rugăm accesaţi colecţia din
|
32
|
+
documentul rădăcină.
|
33
|
+
invalid_field:
|
34
|
+
Folosirea denumirii %{name} ptr. un câmp este interzisă. Vă
|
35
|
+
rugăm să evitaţi utilizarea acelor cuvinte care intră în conflict
|
36
|
+
cu denumirile folosite de proprietăţile sau metodele Mongoid-lui.
|
37
|
+
Folosiţi comanda Document#instance_methods pentru a afla care
|
38
|
+
sunt acestea.
|
39
|
+
too_many_nested_attribute_records:
|
40
|
+
În cazul %{association} folosirea atributelor îmbricate este
|
41
|
+
limitat la %{limit} înregistrări.
|
42
|
+
embedded_in_must_have_inverse_of:
|
43
|
+
Folosirea opţiunii inverse_of este obligatorie în cazul
|
44
|
+
asociaţiilor de tip embedded_in.
|
45
|
+
dependent_only_references_one_or_many:
|
46
|
+
Opţiunea dependent => destroy|delete poate fi folosită doar în
|
47
|
+
cazul asociaţiilor de tip references_one sau references_many.
|
48
|
+
association_cant_have_inverse_of:
|
49
|
+
Folosire opţiunii inverse_of la acest tip de asociaţie este
|
50
|
+
interzisă. Aceasta poate fi folosită doar la asociaţiile de
|
51
|
+
tip embedded_in sau references_many as array.
|
52
|
+
calling_document_find_with_nil_is_invalid:
|
53
|
+
Folosirea metodei Document#find cu valoarea nil este invalidă.
|
54
|
+
unsaved_document:
|
55
|
+
You cannot call create or create! through a relational association
|
56
|
+
relation (%{document}) who's parent (%{base}) is not already saved.
|
57
|
+
mixed_relations:
|
58
|
+
Referencing a(n) %{embedded} document from the %{root} document via a
|
59
|
+
relational association is not allowed since the %{embedded} is embedded.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
ru:
|
2
|
+
mongoid:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
taken:
|
6
|
+
уже занят
|
7
|
+
callbacks:
|
8
|
+
"Calling %{method} on %{klass} resulted in a false return from a callback."
|
9
|
+
document_not_found:
|
10
|
+
Документ класса %{klass} с id %{identifiers} не найден.
|
11
|
+
eager_load:
|
12
|
+
"Eager loading :%{name} is not supported due to it being a many-to-many
|
13
|
+
or polymorphic belongs_to relation."
|
14
|
+
invalid_database:
|
15
|
+
База данных должна быть Mongo::DB, а не %{name}.
|
16
|
+
invalid_time:
|
17
|
+
"'%{value}' is not a valid Time."
|
18
|
+
invalid_type:
|
19
|
+
Поле уже было определено в классе %{klass}, но получено как %{other}
|
20
|
+
со значением %{value}.
|
21
|
+
invalid_options:
|
22
|
+
"Invalid option :%{invalid} provided to relation :%{name}. Valid options
|
23
|
+
are: %{valid}."
|
24
|
+
unsupported_version:
|
25
|
+
Версия MongoDB %{version} не поддерживается. Пожалуйста, обновитесь до
|
26
|
+
версии %{mongo_version}.
|
27
|
+
validations:
|
28
|
+
Документ не прошёл валидацию - %{errors}.
|
29
|
+
invalid_collection:
|
30
|
+
Доступ к коллекции для класса %{klass} запрещён, так как это вложенный
|
31
|
+
документ. Пожалуйста, обратитесь к коллекции через родительский документ.
|
32
|
+
invalid_field:
|
33
|
+
Определение поля с именем %{name} запрещено. Не определяйте поля
|
34
|
+
с именами совпадающими с внутренними атрибутами или методами Mongoid.
|
35
|
+
Используйте Document#instance_methods для просмотра запрещённых имён.
|
36
|
+
too_many_nested_attribute_records:
|
37
|
+
Accepting nested attributes для %{association} ограничено
|
38
|
+
%{limit} записями.
|
39
|
+
embedded_in_must_have_inverse_of:
|
40
|
+
Указание опции inverse_of для embedded_in ассоциации обязательно.
|
41
|
+
dependent_only_references_one_or_many:
|
42
|
+
Опция dependent => destroy|delete доступная только для
|
43
|
+
references_one или references_many ассоциаций.
|
44
|
+
association_cant_have_inverse_of:
|
45
|
+
Опция inverse_of не может использоваться с этой ассоциацией.
|
46
|
+
Используйте её с embedded_in или references_many ассоциациями.
|
47
|
+
calling_document_find_with_nil_is_invalid:
|
48
|
+
Вызов Document#find с nil запрещён
|
49
|
+
unsaved_document:
|
50
|
+
Вызов методов create или create! запрещён у реляционной ассоциации
|
51
|
+
(%{document}), у которой родитель (%{base}) не сохранён.
|
52
|
+
mixed_relations:
|
53
|
+
Referencing a(n) %{embedded} document from the %{root} document via a
|
54
|
+
relational association is not allowed since the %{embedded} is embedded.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
sv:
|
2
|
+
mongoid:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
taken:
|
6
|
+
har redan använts
|
7
|
+
callbacks:
|
8
|
+
"Calling %{method} on %{klass} resulted in a false return from a callback."
|
9
|
+
document_not_found:
|
10
|
+
Inget dokument kunde hittas för klass %{klass} med id %{identifiers}.
|
11
|
+
eager_load:
|
12
|
+
"Eager loading :%{name} is not supported due to it being a many-to-many
|
13
|
+
or polymorphic belongs_to relation."
|
14
|
+
invalid_database:
|
15
|
+
Databasen bör vara Mongo::DB, inte %{name}.
|
16
|
+
invalid_time:
|
17
|
+
"'%{value}' is not a valid Time."
|
18
|
+
invalid_type:
|
19
|
+
Fältet var definerat som %{klass}, men fick %{other} med
|
20
|
+
värdet %{value}.
|
21
|
+
invalid_options:
|
22
|
+
"Invalid option :%{invalid} provided to relation :%{name}. Valid options
|
23
|
+
are: %{valid}."
|
24
|
+
unsupported_version:
|
25
|
+
MongoDB %{version} stöds ej, vänligen upgradera
|
26
|
+
till %{mongo_version}.
|
27
|
+
validations:
|
28
|
+
Validering misslyckades - %{errors}.
|
29
|
+
invalid_collection:
|
30
|
+
Tillgång till kollektionen för %{klass} är inte tillåten eftersom den
|
31
|
+
är ett inbäddat dokument, vänligen accessa kollektionen från
|
32
|
+
rotdokumentet.
|
33
|
+
invalid_field:
|
34
|
+
Att definera ett fält med namnet %{name} är inte tillåtet. Definera inte
|
35
|
+
fält som är i konflikt med Mongoids interna attribut eller metod
|
36
|
+
namn. Använd Document#instance_methods för att se vilka namn detta innefattar.
|
37
|
+
too_many_nested_attribute_records:
|
38
|
+
Acceptans av nästlade attribut för %{association} är begränsat
|
39
|
+
till %{limit} register.
|
40
|
+
embedded_in_must_have_inverse_of:
|
41
|
+
Alternativ för en embedded_in association måste innehålla inverse_of.
|
42
|
+
dependent_only_references_one_or_many:
|
43
|
+
Alternativet dependent => destroy|delete som angavs
|
44
|
+
är endast giltigt för references_one eller references_many associationer.
|
45
|
+
association_cant_have_inverse_of:
|
46
|
+
Att definera inverse_of på denna association är inte tillåtet. Använd
|
47
|
+
endast detta alternativ på embedded_in eller references_many as array.
|
48
|
+
unsaved_document:
|
49
|
+
You cannot call create or create! through a relational association
|
50
|
+
relation (%{document}) who's parent (%{base}) is not already saved.
|
51
|
+
mixed_relations:
|
52
|
+
Referencing a(n) %{embedded} document from the %{root} document via a
|
53
|
+
relational association is not allowed since the %{embedded} is embedded.
|
@@ -0,0 +1,55 @@
|
|
1
|
+
vi:
|
2
|
+
mongoid:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
taken:
|
6
|
+
đã bị lấy
|
7
|
+
callbacks:
|
8
|
+
"Calling %{method} on %{klass} resulted in a false return from a callback."
|
9
|
+
document_not_found:
|
10
|
+
Không tìm thấy văn bản cho lớp %{klass} với định danh %{identifiers}.
|
11
|
+
eager_load:
|
12
|
+
"Eager loading :%{name} is not supported due to it being a many-to-many
|
13
|
+
or polymorphic belongs_to relation."
|
14
|
+
invalid_database:
|
15
|
+
Cơ sở dữ liệu nên là Mongo::DB, không phải %{name}.
|
16
|
+
invalid_time:
|
17
|
+
"'%{value}' is not a valid Time."
|
18
|
+
invalid_type:
|
19
|
+
Trường được định nghĩa là một %{klass}, nhưng nhận được %{other} với
|
20
|
+
giá trị %{value}.
|
21
|
+
invalid_options:
|
22
|
+
"Invalid option :%{invalid} provided to relation :%{name}. Valid options
|
23
|
+
are: %{valid}."
|
24
|
+
unsupported_version:
|
25
|
+
MongoDB %{version} không được hỗ trợ, xin vui lòng nâng cấp
|
26
|
+
lên %{mongo_version}.
|
27
|
+
validations:
|
28
|
+
Kiểm định không thành công - %{errors}.
|
29
|
+
invalid_collection:
|
30
|
+
Không được phép truy cập tập văn bản cuả %{klass} vì đây
|
31
|
+
là một văn bản nhúng, xin vui lòng truy cập tập văn bản từ
|
32
|
+
văn bản gốc.
|
33
|
+
invalid_field:
|
34
|
+
Không được phép định nghĩa tên trường là %{name}. Không định nghĩa
|
35
|
+
tên trường trùng với các thuộc tính có sẵn hoặc các tên hàm cuả Mongoid.
|
36
|
+
Sử dụng Use Document#instance_methods để xem danh sách tên đã được dùng.
|
37
|
+
too_many_nested_attribute_records:
|
38
|
+
Số lượng các thuộc tính lồng cho %{association} bị giới hạn
|
39
|
+
ở %{limit} bản ghi.
|
40
|
+
embedded_in_must_have_inverse_of:
|
41
|
+
Phải cho thêm inverse_of vào lực chọn cuả kết hợp embedded_in.
|
42
|
+
dependent_only_references_one_or_many:
|
43
|
+
Lựa chọn dependent => destroy|delete
|
44
|
+
chỉ có hiệu lực với kết hợp references_one hoặc references_many.
|
45
|
+
association_cant_have_inverse_of:
|
46
|
+
Không được phép định nghĩa inverse_of cho kết hợp này. Chỉ
|
47
|
+
sử dụng lựa chọn này cho embedded_in or references_many as array.
|
48
|
+
calling_document_find_with_nil_is_invalid:
|
49
|
+
Không được phép gọi Document#find với giá trị nil
|
50
|
+
unsaved_document:
|
51
|
+
Bạn không được gọi create hoặc create! thông qua một quan hệ kết hợp
|
52
|
+
mà văn bản gốc (%{base}) chưa được lưu.
|
53
|
+
mixed_relations:
|
54
|
+
Không được phép tham chiếu một văn bản %{embedded} từ văn bản %{root} thông qua một
|
55
|
+
quan hệ kết hợp vì %{embedded} là kiểu nhúng.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
zh-CN:
|
2
|
+
mongoid:
|
3
|
+
errors:
|
4
|
+
messages:
|
5
|
+
blank:
|
6
|
+
不能为空
|
7
|
+
callbacks:
|
8
|
+
"Calling %{method} on %{klass} resulted in a false return from a callback."
|
9
|
+
taken:
|
10
|
+
已占用
|
11
|
+
document_not_found:
|
12
|
+
没有发现类是%{klass}id(s)是%{identifiers}的文档
|
13
|
+
eager_load:
|
14
|
+
"Eager loading :%{name} is not supported due to it being a many-to-many
|
15
|
+
or polymorphic belongs_to relation."
|
16
|
+
invalid_database:
|
17
|
+
数据库应该是Mongo::DB,而不是%{name}.
|
18
|
+
invalid_time:
|
19
|
+
"'%{value}' is not a valid Time."
|
20
|
+
invalid_type:
|
21
|
+
在类%{klass}中定义了字段,实际值是%{value}的%{other}.
|
22
|
+
invalid_options:
|
23
|
+
"Invalid option :%{invalid} provided to relation :%{name}. Valid options
|
24
|
+
are: %{valid}."
|
25
|
+
unsupported_version:
|
26
|
+
MongoDB %{version} 版本已过期,请升级到 %{mongo_version}.
|
27
|
+
validations:
|
28
|
+
校验失败 - %{errors}.
|
29
|
+
invalid_collection:
|
30
|
+
不允许直接访问嵌入式的集合%{klass} , 请从文档的根访问集合.
|
31
|
+
invalid_field:
|
32
|
+
字段的名字不允许为 %{name}. 你不应该定义跟Mongoid内部属性或者方法相同的名字,详细请看Use Document#instance_methods.
|
33
|
+
too_many_nested_attribute_records:
|
34
|
+
被关联的%{association} 嵌入式属性不能超过 %{limit}.
|
35
|
+
embedded_in_must_have_inverse_of:
|
36
|
+
embedded_in的关联属性必须包含inverse_of.
|
37
|
+
dependent_only_references_one_or_many:
|
38
|
+
dependent => destroy|delete 选项只有在references_one或者references_many时候有效.
|
39
|
+
association_cant_have_inverse_of:
|
40
|
+
在当前的关联中,不允许定义inverse_of去,其只有在embedded_in或者references_many是数组的情况下使用
|
41
|
+
unsaved_document:
|
42
|
+
You cannot call create or create! through a relational association
|
43
|
+
relation (%{document}) who's parent (%{base}) is not already saved.
|
44
|
+
mixed_relations:
|
45
|
+
Referencing a(n) %{embedded} document from the %{root} document via a
|
46
|
+
relational association is not allowed since the %{embedded} is embedded.
|
data/lib/mongoid.rb
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# Copyright (c) 2009 - 2011 Durran Jordan and friends.
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
# a copy of this software and associated documentation files (the
|
7
|
+
# "Software"), to deal in the Software without restriction, including
|
8
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
# the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be
|
14
|
+
# included in all copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
require "delegate"
|
24
|
+
require "time"
|
25
|
+
require "active_support/core_ext"
|
26
|
+
require 'active_support/json'
|
27
|
+
require "active_support/inflector"
|
28
|
+
require "active_support/lazy_load_hooks"
|
29
|
+
require "active_support/time_with_zone"
|
30
|
+
require "active_model"
|
31
|
+
require "mongo"
|
32
|
+
require "mongoid/extensions"
|
33
|
+
require "mongoid/errors"
|
34
|
+
require "mongoid/threaded"
|
35
|
+
require "mongoid/relations"
|
36
|
+
require "mongoid/atomic"
|
37
|
+
require "mongoid/attributes"
|
38
|
+
require "mongoid/callbacks"
|
39
|
+
require "mongoid/collection"
|
40
|
+
require "mongoid/collections"
|
41
|
+
require "mongoid/config"
|
42
|
+
require "mongoid/contexts"
|
43
|
+
require "mongoid/copyable"
|
44
|
+
require "mongoid/criteria"
|
45
|
+
require "mongoid/cursor"
|
46
|
+
require "mongoid/default_scope"
|
47
|
+
require "mongoid/dirty"
|
48
|
+
require "mongoid/extras"
|
49
|
+
require "mongoid/factory"
|
50
|
+
require "mongoid/fields"
|
51
|
+
require "mongoid/finders"
|
52
|
+
require "mongoid/hierarchy"
|
53
|
+
require "mongoid/identity"
|
54
|
+
require "mongoid/identity_map"
|
55
|
+
require "mongoid/indexes"
|
56
|
+
require "mongoid/inspection"
|
57
|
+
require "mongoid/javascript"
|
58
|
+
require "mongoid/json"
|
59
|
+
require "mongoid/keys"
|
60
|
+
require "mongoid/logger"
|
61
|
+
require "mongoid/matchers"
|
62
|
+
require "mongoid/multi_parameter_attributes"
|
63
|
+
require "mongoid/multi_database"
|
64
|
+
require "mongoid/named_scope"
|
65
|
+
require "mongoid/nested_attributes"
|
66
|
+
require "mongoid/observer"
|
67
|
+
require "mongoid/persistence"
|
68
|
+
require "mongoid/reloading"
|
69
|
+
require "mongoid/safety"
|
70
|
+
require "mongoid/scope"
|
71
|
+
require "mongoid/serialization"
|
72
|
+
require "mongoid/sharding"
|
73
|
+
require "mongoid/state"
|
74
|
+
require "mongoid/timestamps"
|
75
|
+
require "mongoid/validations"
|
76
|
+
require "mongoid/versioning"
|
77
|
+
require "mongoid/components"
|
78
|
+
require "mongoid/paranoia"
|
79
|
+
require "mongoid/document"
|
80
|
+
|
81
|
+
# If we are using Rails then we will include the Mongoid railtie. This has all
|
82
|
+
# the nifty initializers that Mongoid needs.
|
83
|
+
if defined?(Rails)
|
84
|
+
require "mongoid/railtie"
|
85
|
+
end
|
86
|
+
|
87
|
+
# If we are using any Rack based application then we need the Mongoid rack
|
88
|
+
# middleware to ensure our app is running properly.
|
89
|
+
if defined?(Rack)
|
90
|
+
require "rack/mongoid"
|
91
|
+
end
|
92
|
+
|
93
|
+
# add english load path by default
|
94
|
+
I18n.load_path << File.join(File.dirname(__FILE__), "config", "locales", "en.yml")
|
95
|
+
|
96
|
+
module Mongoid #:nodoc
|
97
|
+
extend self
|
98
|
+
|
99
|
+
MONGODB_VERSION = "2.0.0"
|
100
|
+
|
101
|
+
# Sets the Mongoid configuration options. Best used by passing a block.
|
102
|
+
#
|
103
|
+
# @example Set up configuration options.
|
104
|
+
# Mongoid.configure do |config|
|
105
|
+
# name = "mongoid_test"
|
106
|
+
# host = "localhost"
|
107
|
+
# config.allow_dynamic_fields = false
|
108
|
+
# config.master = Mongo::Connection.new.db(name)
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# @return [ Config ] The configuration obejct.
|
112
|
+
#
|
113
|
+
# @since 1.0.0
|
114
|
+
def configure
|
115
|
+
block_given? ? yield(Config) : Config
|
116
|
+
end
|
117
|
+
alias :config :configure
|
118
|
+
|
119
|
+
# We can process a unit of work in Mongoid and have the identity map
|
120
|
+
# automatically clear itself out after the work is complete.
|
121
|
+
#
|
122
|
+
# @example Process a unit of work.
|
123
|
+
# Mongoid.unit_of_work do
|
124
|
+
# Person.create(:title => "Sir")
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# @return [ Object ] The result of the block.
|
128
|
+
#
|
129
|
+
# @since 2.1.0
|
130
|
+
def unit_of_work
|
131
|
+
begin
|
132
|
+
yield if block_given?
|
133
|
+
ensure
|
134
|
+
IdentityMap.clear
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Take all the public instance methods from the Config singleton and allow
|
139
|
+
# them to be accessed through the Mongoid module directly.
|
140
|
+
#
|
141
|
+
# @example Delegate the configuration methods.
|
142
|
+
# Mongoid.database = Mongo::Connection.new.db("test")
|
143
|
+
#
|
144
|
+
# @since 1.0.0
|
145
|
+
delegate *(Config.public_instance_methods(false) +
|
146
|
+
ActiveModel::Observing::ClassMethods.public_instance_methods(false) <<
|
147
|
+
{ :to => Config })
|
148
|
+
end
|