ack_rocket_cms 0.7.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +19 -0
  7. data/Gemfile +5 -0
  8. data/Gemfile.lock +244 -0
  9. data/LICENSE.txt +22 -0
  10. data/README.md +74 -0
  11. data/Rakefile +1 -0
  12. data/app/assets/javascripts/head.load.js +707 -0
  13. data/app/assets/javascripts/jquery.placeholder.js +157 -0
  14. data/app/assets/javascripts/rocket_cms.js.coffee +10 -0
  15. data/app/assets/javascripts/rocket_cms/flash.js.coffee +3 -0
  16. data/app/assets/javascripts/rocket_cms/map.js.coffee +22 -0
  17. data/app/assets/stylesheets/rocket_cms.css.sass +6 -0
  18. data/app/assets/stylesheets/rocket_cms/flash.css.sass +66 -0
  19. data/app/assets/stylesheets/rocket_cms/normalize.css.scss +406 -0
  20. data/app/controllers/concerns/no_cache.rb +12 -0
  21. data/app/controllers/concerns/rs_errors.rb +63 -0
  22. data/app/controllers/concerns/rs_menu.rb +45 -0
  23. data/app/controllers/concerns/rs_pages.rb +41 -0
  24. data/app/controllers/contacts_controller.rb +3 -0
  25. data/app/controllers/home_controller.rb +5 -0
  26. data/app/controllers/news_controller.rb +3 -0
  27. data/app/controllers/pages_controller.rb +4 -0
  28. data/app/controllers/search_controller.rb +4 -0
  29. data/app/mailers/contact_mailer.rb +15 -0
  30. data/app/models/concerns/boolean_field.rb +17 -0
  31. data/app/models/concerns/enableable.rb +8 -0
  32. data/app/models/concerns/geocodeable.rb +4 -0
  33. data/app/models/concerns/mappable.rb +95 -0
  34. data/app/models/concerns/seoable.rb +42 -0
  35. data/app/models/concerns/sitemap_data.rb +20 -0
  36. data/app/models/concerns/sort_field.rb +17 -0
  37. data/app/models/concerns/sortable.rb +8 -0
  38. data/app/models/contact_message.rb +11 -0
  39. data/app/models/menu.rb +11 -0
  40. data/app/models/news.rb +10 -0
  41. data/app/models/page.rb +11 -0
  42. data/app/views/blocks/_footer.html.haml +1 -0
  43. data/app/views/contact_mailer/new_message_email.html.haml +16 -0
  44. data/app/views/contacts/index.html.haml +10 -0
  45. data/app/views/contacts/new.html.haml +10 -0
  46. data/app/views/contacts/sent.html.haml +4 -0
  47. data/app/views/errors/_base.html.haml +3 -0
  48. data/app/views/errors/error_403.html.haml +1 -0
  49. data/app/views/errors/error_404.html.haml +1 -0
  50. data/app/views/errors/error_500.html.haml +1 -0
  51. data/app/views/home/index.html.haml +1 -0
  52. data/app/views/layouts/application.html.haml +23 -0
  53. data/app/views/layouts/application.html.slim +24 -0
  54. data/app/views/news/index.html.haml +9 -0
  55. data/app/views/news/show.html.haml +8 -0
  56. data/app/views/pages/show.html.haml +1 -0
  57. data/app/views/rails_admin/main/_check_boxes.html.haml +27 -0
  58. data/app/views/rails_admin/main/_enum_check_boxes.html.haml +5 -0
  59. data/app/views/rails_admin/main/_enum_radio_buttons.html.haml +5 -0
  60. data/app/views/rails_admin/main/_form_raw.html.haml +1 -0
  61. data/app/views/search/index.html.haml +19 -0
  62. data/app/views/shared/_admin_link.html.haml +3 -0
  63. data/app/views/shared/_messages.html.haml +7 -0
  64. data/app/views/shared/_meta.html.haml +6 -0
  65. data/app/views/shared/_obj.html.haml +20 -0
  66. data/app/views/shared/_og.html.haml +4 -0
  67. data/config/locales/en.rocket_admin.yml +6 -0
  68. data/config/locales/en.rs.yml +20 -0
  69. data/config/locales/ru.cancan.yml +4 -0
  70. data/config/locales/ru.devise.yml +65 -0
  71. data/config/locales/ru.kaminari.yml +17 -0
  72. data/config/locales/ru.models.yml +92 -0
  73. data/config/locales/ru.mongoid.yml +450 -0
  74. data/config/locales/ru.rails_admin.yml +148 -0
  75. data/config/locales/ru.rocket_admin.yml +6 -0
  76. data/config/locales/ru.rs.yml +20 -0
  77. data/config/locales/ru.simple_captcha.yml +3 -0
  78. data/config/locales/ru.simple_form.yml +9 -0
  79. data/lib/filename_to_slug.rb +34 -0
  80. data/lib/generators/rocket_cms/ability_generator.rb +15 -0
  81. data/lib/generators/rocket_cms/admin_generator.rb +21 -0
  82. data/lib/generators/rocket_cms/capify_generator.rb +40 -0
  83. data/lib/generators/rocket_cms/layout_generator.rb +15 -0
  84. data/lib/generators/rocket_cms/migration_generator.rb +19 -0
  85. data/lib/generators/rocket_cms/templates/Capfile +17 -0
  86. data/lib/generators/rocket_cms/templates/ability.erb +28 -0
  87. data/lib/generators/rocket_cms/templates/admin.erb +81 -0
  88. data/lib/generators/rocket_cms/templates/deploy.erb +47 -0
  89. data/lib/generators/rocket_cms/templates/dl.erb +30 -0
  90. data/lib/generators/rocket_cms/templates/migration_contact_messages.rb +15 -0
  91. data/lib/generators/rocket_cms/templates/migration_news.rb +21 -0
  92. data/lib/generators/rocket_cms/templates/migration_pages.rb +36 -0
  93. data/lib/generators/rocket_cms/templates/production.erb +8 -0
  94. data/lib/generators/rocket_cms/templates/unicorn.erb +66 -0
  95. data/lib/generators/rocket_cms/utils.rb +22 -0
  96. data/lib/manual_slug.rb +11 -0
  97. data/lib/manual_slug/active_record.rb +32 -0
  98. data/lib/manual_slug/mongoid.rb +36 -0
  99. data/lib/rails_admin/custom_show_in_app.rb +39 -0
  100. data/lib/rocket_cms.rb +88 -0
  101. data/lib/rocket_cms/admin.rb +152 -0
  102. data/lib/rocket_cms/configuration.rb +67 -0
  103. data/lib/rocket_cms/controller.rb +24 -0
  104. data/lib/rocket_cms/controllers/contacts.rb +70 -0
  105. data/lib/rocket_cms/controllers/news.rb +31 -0
  106. data/lib/rocket_cms/controllers/pages.rb +19 -0
  107. data/lib/rocket_cms/controllers/search.rb +45 -0
  108. data/lib/rocket_cms/elastic_search.rb +31 -0
  109. data/lib/rocket_cms/engine.rb +39 -0
  110. data/lib/rocket_cms/migration.rb +31 -0
  111. data/lib/rocket_cms/model.rb +25 -0
  112. data/lib/rocket_cms/models/active_record/contact_message.rb +14 -0
  113. data/lib/rocket_cms/models/active_record/menu.rb +14 -0
  114. data/lib/rocket_cms/models/active_record/news.rb +23 -0
  115. data/lib/rocket_cms/models/active_record/page.rb +17 -0
  116. data/lib/rocket_cms/models/contact_message.rb +27 -0
  117. data/lib/rocket_cms/models/menu.rb +29 -0
  118. data/lib/rocket_cms/models/mongoid/contact_message.rb +20 -0
  119. data/lib/rocket_cms/models/mongoid/menu.rb +12 -0
  120. data/lib/rocket_cms/models/mongoid/news.rb +27 -0
  121. data/lib/rocket_cms/models/mongoid/page.rb +26 -0
  122. data/lib/rocket_cms/models/news.rb +50 -0
  123. data/lib/rocket_cms/models/page.rb +76 -0
  124. data/lib/rocket_cms/patch.rb +58 -0
  125. data/lib/rocket_cms/rails_admin_menu.rb +145 -0
  126. data/lib/rocket_cms/simple_form_patch.rb +12 -0
  127. data/lib/rocket_cms/tasks.rb +13 -0
  128. data/lib/rocket_cms/version.rb +3 -0
  129. data/release.sh +13 -0
  130. data/rocket_cms.gemspec +54 -0
  131. data/template.rb +557 -0
  132. metadata +533 -0
@@ -0,0 +1,450 @@
1
+ ru:
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_found:
35
+ message: "Document(s) not found for class %{klass} with id(s) %{missing}."
36
+ summary: "When calling %{klass}.find with an id or array of ids, each
37
+ parameter must match a document in the database or this error will be
38
+ raised. The search was for the id(s): %{searched} (%{total} total)
39
+ and the following ids were not found: %{missing}."
40
+ resolution: "Search for an id that is in the database or set
41
+ the Mongoid.raise_not_found_error configuration option to false,
42
+ which will cause a nil to be returned instead of raising this error when
43
+ searching for a single id, or only the matched documents when searching
44
+ for multiples."
45
+ document_with_attributes_not_found:
46
+ message: "Document not found for class %{klass} with attributes %{attributes}."
47
+ summary: "When calling %{klass}.find_by with a hash of attributes, all
48
+ attributes provided must match a document in the database or this error
49
+ will be raised."
50
+ resolution: "Search for attributes that are in the database or set
51
+ the Mongoid.raise_not_found_error configuration option to false,
52
+ which will cause a nil to be returned instead of raising this error."
53
+ eager_load:
54
+ message: "Eager loading :%{name} is not supported since it is a
55
+ polymorphic belongs_to relation."
56
+ summary: "Mongoid cannot currently determine the classes it needs to
57
+ eager load when the relation is polymorphic. The parents reside in
58
+ different collections so a simple id lookup is not sufficient enough."
59
+ resolution: "Don't attempt to perform this action and have patience,
60
+ maybe this will be supported in the future."
61
+ invalid_collection:
62
+ message: "Access to the collection for %{klass} is not allowed."
63
+ summary: "%{klass}.collection was called, and %{klass} is an embedded
64
+ document - it resides within the collection of the root document of
65
+ the hierarchy."
66
+ resolution: "For access to the collection that the embedded document is
67
+ in, use %{klass}#_root.collection, or do not attempt to persist an
68
+ embedded document without a parent set."
69
+ invalid_config_option:
70
+ message: "Invalid configuration option: %{name}."
71
+ summary: "A invalid configuration option was provided in your
72
+ mongoid.yml, or a typo is potentially present. The valid configuration
73
+ options are: %{options}."
74
+ resolution: "Remove the invalid option or fix the typo. If you were
75
+ expecting the option to be there, please consult the following page
76
+ with repect to Mongoid's configuration:\n\n
77
+ \_\_http://mongoid.org/en/mongoid/docs/installation.html"
78
+ invalid_field:
79
+ message: "Defining a field named '%{name}' is not allowed."
80
+ summary: "Defining this field would override the method '%{name}',
81
+ which would cause issues with expectations around the original
82
+ method and cause extremely hard to debug issues. The original
83
+ method was defined in:\n
84
+ \_\_Object: %{origin}\n
85
+ \_\_File: %{file}\n
86
+ \_\_Line: %{line}"
87
+ resolution: "Use Mongoid.destructive_fields to see what names are not
88
+ allowed, and don't use these names. These include names that also
89
+ conflict with core Ruby methods on Object, Module, Enumerable, or
90
+ included gems that inject methods into these or Mongoid internals."
91
+ invalid_field_option:
92
+ message: "Invalid option :%{option} provided for field :%{name}."
93
+ summary: "Mongoid requires that you only provide valid options on each
94
+ field definition in order to prevent unexpected behaviour later on."
95
+ resolution: "When defining the field :%{name} on '%{klass}', please provide
96
+ valid options for the field. These are currently: %{valid}. If you
97
+ meant to define a custom field option, please do so first like so:\n\n
98
+ \_\_Mongoid::Fields.option :%{option} do |model, field, value|\n
99
+ \_\_\_\_# Your logic here...\n
100
+ \_\_end\n
101
+ \_\_class %{klass}\n
102
+ \_\_\_\_include Mongoid::Document\n
103
+ \_\_\_\_field :%{name}, %{option}: true\n
104
+ \_\_end\n\n"
105
+ invalid_includes:
106
+ message: "Invalid includes directive: %{klass}.includes(%{args})"
107
+ summary: "Eager loading in Mongoid only supports providing arguments
108
+ to %{klass}.includes that are the names of relations on the %{klass}
109
+ model, and only supports one level of eager loading. (ie, eager loading
110
+ associations not on the %{klass} but one step away via another relation
111
+ is not allowed."
112
+ resolution: "Ensure that each parameter passed to %{klass}.includes is
113
+ a valid name of a relation on the %{klass} model. These are: %{relations}."
114
+ invalid_index:
115
+ message: "Invalid index specification on %{klass}: %{spec}, %{options}"
116
+ summary: "Indexes in Mongoid are defined as a hash of field name and
117
+ direction/2d pairs, with a hash for any additional options."
118
+ resolution: "Ensure that the index conforms to the correct syntax and
119
+ has the correct options.\n\n
120
+ Valid options are:\n
121
+ \_\_background: true|false\n
122
+ \_\_drop_dups: true|false\n
123
+ \_\_name: 'index_name'\n
124
+ \_\_sparse: true|false\n
125
+ \_\_unique: true|false\n
126
+ \_\_min: 1\n
127
+ \_\_max: 1\n
128
+ \_\_bits: 26\n
129
+ \_\_bucket_size : 1\n
130
+ \_\_weights: { content: 1, title: 2 }\n
131
+ Valid types are: 1, -1, '2d', '2dsphere', 'geoHaystack', 'text', 'hashed'\n\n
132
+ Example:\n
133
+ \_\_class Band\n
134
+ \_\_\_\_include Mongoid::Document\n
135
+ \_\_\_\_index({ name: 1, label: -1 }, { sparse: true })\n
136
+ \_\_\_\_index({ location: '2d' }, { background: true })\n
137
+ \_\_end\n\n"
138
+ invalid_options:
139
+ message: "Invalid option :%{invalid} provided to relation :%{name}."
140
+ summary: "Mongoid checks the options that are passed to the relation
141
+ macros to ensure that no ill side effects occur by letting something
142
+ slip by."
143
+ resolution: "Valid options are: %{valid}, make sure these are the ones
144
+ you are using."
145
+ invalid_path:
146
+ message: "Having a root path assigned for %{klass} is invalid."
147
+ summary: "Mongoid has two different path objects for determining
148
+ the location of a document in the database, Root and Embedded.
149
+ This error is raised when an embedded document somehow gets a
150
+ root path assigned."
151
+ resolution: "Most likely your embedded model, %{klass} is also
152
+ referenced via a has_many from a root document in another
153
+ collection. Double check the relation definitions and fix any
154
+ instances where embedded documents are improperly referenced
155
+ from other collections."
156
+ invalid_scope:
157
+ message: "Defining a scope of value %{value} on %{klass} is not
158
+ allowed."
159
+ summary: "Scopes in Mongoid must be either criteria objects or procs
160
+ that wrap criteria objects."
161
+ resolution: "Change the scope to be a criteria or proc wrapped
162
+ critera.\n\n
163
+ Example:\n
164
+ \_\_class Band\n
165
+ \_\_\_\_include Mongoid::Document\n
166
+ \_\_\_\_field :active, type: Boolean, default: true\n
167
+ \_\_\_\_scope :active, where(active: true)\n
168
+ \_\_\_\_scope :inactive, ->{ where(active: false) }\n
169
+ \_\_end\n\n"
170
+ invalid_storage_options:
171
+ message: "Invalid options passed to %{klass}.store_in: %{options}."
172
+ summary: "The :store_in macro takes only a hash of parameters with
173
+ the keys :database, :collection, or :session."
174
+ resolution: "Change the options passed to store_in to match the
175
+ documented API, and ensure all keys in the options hash are
176
+ symbols.\n\n
177
+ Example:\n
178
+ \_\_class Band\n
179
+ \_\_\_\_include Mongoid::Document\n
180
+ \_\_\_\_store_in collection: 'artists', database: 'secondary'\n
181
+ \_\_end\n\n"
182
+ invalid_time:
183
+ message: "'%{value}' is not a valid Time."
184
+ summary: "Mongoid tries to serialize the values for Date, DateTime, and
185
+ Time into proper UTC times to store in the database. The provided
186
+ value could not be parsed."
187
+ resolution: "Make sure to pass parsable values to the field setter
188
+ for Date, DateTime, and Time objects. When this is a String it needs
189
+ to be valid for Time.parse. Other objects must be valid to pass to
190
+ Time.local."
191
+ inverse_not_found:
192
+ message: "When adding a(n) %{klass} to %{base}#%{name}, Mongoid could
193
+ not determine the inverse foreign key to set. The attempted key was
194
+ '%{inverse}'."
195
+ summary: "When adding a document to a relation, Mongoid attempts
196
+ to link the newly added document to the base of the relation in
197
+ memory, as well as set the foreign key to link them on the
198
+ database side. In this case Mongoid could not determine what the
199
+ inverse foreign key was."
200
+ resolution: "If an inverse is not required, like a belongs_to or
201
+ has_and_belongs_to_many, ensure that :inverse_of => nil is set
202
+ on the relation. If the inverse is needed, most likely the
203
+ inverse cannot be figured out from the names of the relations and
204
+ you will need to explicitly tell Mongoid on the relation what
205
+ the inverse is.\n\n
206
+ Example:\n
207
+ \_\_class Lush\n
208
+ \_\_\_\_include Mongoid::Document\n
209
+ \_\_\_\_has_one :whiskey, class_name: \"Drink\", inverse_of: :alcoholic\n
210
+ \_\_end\n\n
211
+ \_\_class Drink\n
212
+ \_\_\_\_include Mongoid::Document\n
213
+ \_\_\_\_belongs_to :alcoholic, class_name: \"Lush\", inverse_of: :whiskey\n
214
+ \_\_end"
215
+ invalid_set_polymorphic_relation:
216
+ message: "The %{name} attribute can't be set to an instance of
217
+ %{other_klass} as %{other_klass} has multiple relations referencing
218
+ %{klass} as %{name}."
219
+ summary: "If the parent class of a polymorphic relation has multiple
220
+ definitions for the same relation, the values must be set from the
221
+ parent side and not the child side since Mongoid cannot determine
222
+ from the child side which relation to go in."
223
+ resolution: "Set the values from the parent, or redefine the relation
224
+ with only a single definition in the parent."
225
+ invalid_value:
226
+ message: "Value of type %{value_class} cannot be written to a field of type %{field_class}"
227
+ summary: "Tried to set a value of type %{value_class} to a field of type %{field_class}"
228
+ resolution: "Verify if the value to be set correspond to field definition"
229
+ mixed_relations:
230
+ message: "Referencing a(n) %{embedded} document from the %{root}
231
+ document via a relational association is not allowed since the
232
+ %{embedded} is embedded."
233
+ summary: "In order to properly access a(n) %{embedded} from %{root}
234
+ the reference would need to go through the root document of
235
+ %{embedded}. In a simple case this would require Mongoid to store
236
+ an extra foreign key for the root, in more complex cases where
237
+ %{embedded} is multiple levels deep a key would need to be stored
238
+ for each parent up the hierarchy."
239
+ resolution: "Consider not embedding %{embedded}, or do the key
240
+ storage and access in a custom manner in the application code."
241
+ mixed_session_configuration:
242
+ message: "Both uri and standard configuration options defined for
243
+ session: '%{name}'."
244
+ summary: "Instead of simply giving uri or standard options a
245
+ preference order, Mongoid assumes that you have made a mistake in
246
+ your configuration and requires that you provide one or the other,
247
+ but not both. The options that were provided were: %{config}."
248
+ resolution: "Provide either only a uri as configuration or only
249
+ standard options."
250
+ nested_attributes_metadata_not_found:
251
+ message: "Could not find metadata for relation '%{name}' on model:
252
+ %{klass}."
253
+ summary: "When defining nested attributes for a relation, Mongoid
254
+ needs to access the metadata for the relation '%{name}' in order
255
+ if add autosave functionality to it, if applicable. Either no
256
+ relation named '%{name}' could be found, or the relation had not
257
+ been defined yet."
258
+ resolution: "Make sure that there is a relation defined named
259
+ '%{name}' on %{klass} or that the relation definition comes before
260
+ the accepts_nested_attributes_for macro in the model - order
261
+ matters so that Mongoid has access to the metadata.\n\n
262
+ Example:\n
263
+ \_\_class Band\n
264
+ \_\_\_\_include Mongoid::Document\n
265
+ \_\_\_\_has_many :albums\n
266
+ \_\_\_\_accepts_nested_attributes_for :albums\n
267
+ \_\_end\n\n"
268
+ no_default_session:
269
+ message: "No default session configuration is defined."
270
+ summary: "The configuration provided settings for: %{keys}, but
271
+ Mongoid requires a :default to be defined at minimum."
272
+ resolution: "If configuring via a mongoid.yml, ensure that within
273
+ your :sessions section a :default session is defined.\n\n
274
+ Example:\n
275
+ \_\_development:\n
276
+ \_\_\_\_sessions:\n
277
+ \_\_\_\_\_\_default:\n
278
+ \_\_\_\_\_\_\_\_hosts:\n
279
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
280
+ no_environment:
281
+ message: "Could not load the configuration since no environment
282
+ was defined."
283
+ summary: "Mongoid attempted to find the appropriate environment
284
+ but no Rails.env, Sinatra::Base.environment, RACK_ENV, or
285
+ MONGOID_ENV could be found."
286
+ resolution: "Make sure some environment is set from the mentioned
287
+ options. Mongoid cannot load configuration from the yaml without
288
+ knowing which environment it is in, and we have considered
289
+ defaulting to development an undesireable side effect of this not
290
+ being defined."
291
+ no_map_reduce_output:
292
+ message: "No output location was specified for the map/reduce
293
+ operation."
294
+ summary: "When executing a map/reduce, you must provide the output
295
+ location of the results. The attempted command was: %{command}."
296
+ resolution: "Provide the location that the output of the operation
297
+ is to go by chaining an #out call to the map/reduce.\n\n
298
+ Example:\n
299
+ \_\_Band.map_reduce(map, reduce).out(inline: 1)\n\n
300
+ Valid options for the out function are:\n
301
+ \_\_inline: 1\n
302
+ \_\_merge: 'collection-name'\n
303
+ \_\_replace: 'collection-name'\n
304
+ \_\_reduce: 'collection-name'\n\n"
305
+ no_metadata:
306
+ message: "Metadata not found for document of type %{klass}."
307
+ summary: "Mongoid sets the metadata of a relation on the document
308
+ when it is either loaded from within the relation, or added to
309
+ one. The presence of the metadata is required in order to
310
+ provide various functionality around relations. Most likely you
311
+ are getting this error because the document is embedded and was
312
+ attempted to be persisted without being associated with a parent,
313
+ or the relation was not properly defined."
314
+ resolution: "Ensure that your relations on the %{klass} model
315
+ are all properly defined, and that the inverse relations
316
+ are also properly defined. Embedded relations must have both the
317
+ parent (embeds_one/embeds_many) and the inverse (embedded_in)
318
+ present in order to work properly."
319
+ no_parent:
320
+ message: "Cannot persist embedded document %{klass} without a
321
+ parent document."
322
+ summary: "If the document is embedded, in order to be persisted it
323
+ must always have a reference to its parent document. This is
324
+ most likely caused by either calling %{klass}.create or
325
+ %{klass}.create! without setting the parent document as an
326
+ attribute."
327
+ resolution: "Ensure that you've set the parent relation if
328
+ instantiating the embedded document direcly, or always create new
329
+ embedded documents via the parent relation."
330
+ no_session_config:
331
+ message: "No configuration could be found for a session named
332
+ '%{name}'."
333
+ summary: "When attempting to create the new session, Mongoid could
334
+ not find a session configuration for the name: '%{name}'. This is
335
+ necessary in order to know the host, port, and options needed
336
+ to connect."
337
+ resolution: "Double check your mongoid.yml to make sure under the
338
+ sessions key that a configuration exists for '%{name}'. If you
339
+ have set the configuration programatically, ensure that '%{name}'
340
+ exists in the configuration hash."
341
+ no_sessions_config:
342
+ message: "No sessions configuration provided."
343
+ summary: "Mongoid's configuration requires that you provide details
344
+ about each session that can be connected to, and requires in
345
+ the sessions config at least 1 default session to exist."
346
+ resolution: "Double check your mongoid.yml to make sure that you
347
+ have a top-level sessions key with at least 1 default session
348
+ configuration for it. You can regenerate a new mongoid.yml for
349
+ assistance via `rails g mongoid:config`.\n\n
350
+ Example:\n
351
+ \_\_development:\n
352
+ \_\_\_\_sessions:\n
353
+ \_\_\_\_\_\_default:\n
354
+ \_\_\_\_\_\_\_\_database: mongoid_dev\n
355
+ \_\_\_\_\_\_\_\_hosts:\n
356
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
357
+ no_session_database:
358
+ message: "No database provided for session configuration: :%{name}."
359
+ summary: "Each session configuration must provide a database so Mongoid
360
+ knows where the default database to persist to. What was provided
361
+ was: %{config}."
362
+ resolution: "If configuring via a mongoid.yml, ensure that within
363
+ your :%{name} section a :database value for the session's default
364
+ database is defined.\n\n
365
+ Example:\n
366
+ \_\_development:\n
367
+ \_\_\_\_sessions:\n
368
+ \_\_\_\_\_\_%{name}:\n
369
+ \_\_\_\_\_\_\_\_database: my_app_db\n
370
+ \_\_\_\_\_\_\_\_hosts:\n
371
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
372
+ no_session_hosts:
373
+ message: "No hosts provided for session configuration: :%{name}."
374
+ summary: "Each session configuration must provide hosts so Mongoid
375
+ knows where the database server is located. What was provided
376
+ was: %{config}."
377
+ resolution: "If configuring via a mongoid.yml, ensure that within
378
+ your :%{name} section a :hosts value for the session hosts is
379
+ defined.\n\n
380
+ Example:\n
381
+ \_\_development:\n
382
+ \_\_\_\_sessions:\n
383
+ \_\_\_\_\_\_%{name}:\n
384
+ \_\_\_\_\_\_\_\_database: my_app_db\n
385
+ \_\_\_\_\_\_\_\_hosts:\n
386
+ \_\_\_\_\_\_\_\_\_\_- localhost:27017\n\n"
387
+ readonly_attribute:
388
+ message: "Attempted to set the readonly attribute '%{name}' with
389
+ the value: %{value}."
390
+ summary: "Attributes flagged as readonly via Model.attr_readonly
391
+ can only have values set when the document is a new record."
392
+ resolution: "Don't define '%{name}' as readonly, or do not attempt
393
+ to update its value after the document is persisted."
394
+ scope_overwrite:
395
+ message: "Cannot create scope :%{scope_name}, because of existing
396
+ method %{model_name}.%{scope_name}."
397
+ summary: "When defining a scope that conflicts with a method that
398
+ already exists on the model, this error will get raised if
399
+ Mongoid.scope_overwrite_exception is set to true."
400
+ resolution: "Change the name of the scope so it does not conflict
401
+ with the already defined method %{model_name}, or set the
402
+ configuration option Mongoid.scope_overwrite_exception to false,
403
+ which is its default. In this case a warning will be logged."
404
+ too_many_nested_attribute_records:
405
+ message: "Accepting nested attributes for %{association} is limited
406
+ to %{limit} records."
407
+ summary: "More documents were sent to be processed than the allowed
408
+ limit."
409
+ resolution: "The limit is set as an option to the macro, for example:
410
+ accepts_nested_attributes_for :%{association}, limit: %{limit}.
411
+ Consider raising this limit or making sure no more are sent than
412
+ the set value."
413
+ unknown_attribute:
414
+ message: "Attempted to set a value for '%{name}' which is not
415
+ allowed on the model %{klass}."
416
+ summary: "Without including Mongoid::Attributes::Dynamic in your model
417
+ and the attribute does not already exist in the attributes hash,
418
+ attempting to call %{klass}#%{name}= for it is not allowed. This is
419
+ also triggered by passing the attribute to any method that accepts an
420
+ attributes hash, and is raised instead of getting a NoMethodError."
421
+ resolution: "You can include Mongoid::Attributes::Dynamic if you
422
+ expect to be writing values for undefined fields often."
423
+ unsaved_document:
424
+ message: "Attempted to save %{document} before the parent %{base}."
425
+ summary: "You cannot call create or create! through the
426
+ relation (%{document}) who's parent (%{base}) is
427
+ not already saved. This would case the database to be out of sync
428
+ since the child could potentially reference a nonexistant parent."
429
+ resolution: "Make sure to only use create or create! when the parent
430
+ document %{base} is persisted."
431
+ unsupported_javascript:
432
+ message: "Executing Javascript $where selector on an embedded criteria
433
+ is not supported."
434
+ summary: "Mongoid only supports providing a hash of arguments to
435
+ #where criterion on embedded documents. Since %{klass} is embedded,
436
+ the expression %{javascript} is not allowed."
437
+ resolution: "Please provide a standard hash to #where when the criteria
438
+ is for an embedded relation."
439
+ validations:
440
+ message: "Validation of %{document} failed."
441
+ summary: "The following errors were found: %{errors}"
442
+ resolution: "Try persisting the document with valid data or remove
443
+ the validations."
444
+ delete_restriction:
445
+ message: "Cannot delete %{document} because of dependent '%{relation}'."
446
+ summary: "When defining '%{relation}' with a :dependent => :restrict,
447
+ Mongoid will raise an error when attempting to delete the
448
+ %{document} when the child '%{relation}' still has documents in it."
449
+ resolution: "Don't attempt to delete the parent %{document} when
450
+ it has children, or change the dependent option on the relation."
@@ -0,0 +1,148 @@
1
+ # Russian. Updated 2012-07-18
2
+
3
+ ru:
4
+ admin:
5
+ home:
6
+ name: "Главная"
7
+ pagination:
8
+ previous: "« Предыдущая"
9
+ next: "Следующая »"
10
+ truncate: "…"
11
+ misc:
12
+ filter_date_format: "dd.mm.yyyy"
13
+ search: "Поиск"
14
+ filter: "Фильтрация"
15
+ refresh: "Обновить"
16
+ show_all: "Показать все"
17
+ add_filter: "Добавить фильтр..."
18
+ bulk_menu_title: "Выбранные элементы..."
19
+ remove: "Убрать"
20
+ add_new: "Добавить новый"
21
+ chosen: "Выбрать %{name}"
22
+ chose_all: "Выбрать все"
23
+ clear_all: "Убрать выделение"
24
+ up: "Вверх"
25
+ down: "Вниз"
26
+ navigation: "Навигация"
27
+ log_out: "Выйти"
28
+ ago: "назад"
29
+ flash:
30
+ successful: "%{name} был %{action}"
31
+ error: "Не получилось %{action} %{name}"
32
+ noaction: "Никаких изменений не выполнено"
33
+ model_not_found: "Модель '%{model}' не найден"
34
+ object_not_found: "Объект %{model} с id '%{id}' не найден"
35
+ table_headers:
36
+ items: "Элементы"
37
+ model_name: "Название модели"
38
+ last_used: "Последний раз использовалось"
39
+ records: "Записи"
40
+ username: "Пользователь"
41
+ changes: "Изменения"
42
+ created_at: "Дата/Время"
43
+ item: "Элемент"
44
+ message: "Сообщение"
45
+ actions:
46
+ nestable:
47
+ title: "Сортировка %{model_label}"
48
+ menu: "Сортировать"
49
+ breadcrumb: "Сортировка"
50
+ link: "Сортировать"
51
+ bulk_link: "Сортировка выбранных %{model_label_plural}"
52
+ done: "Сохранено"
53
+ success: "Успешно"
54
+ error: "Ошибка"
55
+ social_auth:
56
+ menu: Авторизовать
57
+
58
+ dashboard:
59
+ title: "Управление сайтом"
60
+ menu: "Контрольная панель"
61
+ breadcrumb: "панель"
62
+ index:
63
+ title: "Список %{model_label_plural}"
64
+ menu: "Список"
65
+ breadcrumb: "%{model_label_plural}"
66
+ show:
67
+ title: "Детали %{model_label} '%{object_label}'"
68
+ menu: "Просмотр"
69
+ breadcrumb: "%{object_label}"
70
+ show_in_app:
71
+ menu: "Показать в приложении"
72
+ new:
73
+ title: "Новый %{model_label}"
74
+ menu: "Создание"
75
+ breadcrumb: "новый"
76
+ link: "Добавить новый %{model_label}"
77
+ done: "создано"
78
+ edit:
79
+ title: "Редактирование %{model_label} '%{object_label}'"
80
+ menu: "Редактирование"
81
+ breadcrumb: "редактирование"
82
+ link: "Редактировать %{model_label}"
83
+ done: "сохранено"
84
+ delete:
85
+ title: "Удаление %{model_label} '%{object_label}'"
86
+ menu: "Удаление"
87
+ breadcrumb: "удаление"
88
+ link: "Удалить '%{object_label}'"
89
+ done: "удалено"
90
+ bulk_delete:
91
+ title: "Удалить много %{model_label_plural}"
92
+ menu: "Мульти-удаление"
93
+ breadcrumb: "мульти-удаление"
94
+ bulk_link: "Удалить выбранные %{model_label_plural}"
95
+ export:
96
+ title: "Экспорт %{model_label}"
97
+ menu: "Экспорт"
98
+ breadcrumb: "экспорт"
99
+ link: "Экспорт найденных %{model_label_plural}"
100
+ bulk_link: "Экспорт выбраных %{model_label_plural}"
101
+ done: "экспортировано"
102
+ history_index:
103
+ title: "История для %{model_label_plural}"
104
+ menu: "История"
105
+ breadcrumb: "история"
106
+ history_show:
107
+ title: "История для %{model_label} '%{object_label}'"
108
+ menu: "История"
109
+ breadcrumb: "история"
110
+ show_in_app:
111
+ title: 'В приложении'
112
+ menu: "Показать на сайте"
113
+ form:
114
+ cancel: "Отмена"
115
+ basic_info: "Основное"
116
+ required: "Требуемое"
117
+ optional: "Необязательное"
118
+ one_char: "символ"
119
+ char_length_up_to: "длина не более"
120
+ char_length_of: "длина"
121
+ save: "Сохранить"
122
+ save_and_add_another: "Сохранить и добавить ещё"
123
+ save_and_edit: "Сохранить и остаться"
124
+ all_of_the_following_related_items_will_be_deleted: "Следующие объекты будут удалены:"
125
+ are_you_sure_you_want_to_delete_the_object: "Вы уверены что хотите удалить %{model_name}"
126
+ confirmation: "Да, уверен"
127
+ delete_confirmation: "Подтвердить удаление"
128
+ bulk_delete: "Следующие объекты будут удалены, что может сломать связи с другими объектами:"
129
+ new_model: "Новый"
130
+ export:
131
+ confirmation: "Экспортировать как %{name}"
132
+ select: "Выберите поля для экспорта"
133
+ fields_from: "Поля из %{name}"
134
+ fields_from_associated: "Поля из ассоциированной %{name}"
135
+ display: "Показать %{name}: %{type}"
136
+ options_for: "Настройки для %{name}"
137
+ empty_value_for_associated_objects: "<пусто>"
138
+ click_to_reverse_selection: 'Обратить выделение'
139
+ csv:
140
+ header_for_root_methods: "%{name}" # 'model' is available
141
+ header_for_association_methods: "%{name} [%{association}]"
142
+ encoding_to: "Декодировать как"
143
+ encoding_to_help: "Выберите результирующую кодировку. Оставьте пустой, чтобы оставить исходную кодировку нетронутой: (%{name})"
144
+ skip_header: "Без заголовка"
145
+ skip_header_help: "Не выводить заголовок (без описаний полей)"
146
+ default_col_sep: ","
147
+ col_sep: "Разделитель столбцов"
148
+ col_sep_help: "Оставьте пустым, чтобы было по умолчанию ('%{value}')" # value is default_col_sep