mongoid 3.1.7 → 4.0.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (521) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +317 -11
  3. data/README.md +4 -5
  4. data/lib/config/locales/en.yml +9 -12
  5. data/lib/mongoid.rb +6 -75
  6. data/lib/mongoid/atomic.rb +0 -11
  7. data/lib/mongoid/atomic/paths/embedded.rb +0 -30
  8. data/lib/mongoid/atomic/paths/root.rb +0 -13
  9. data/lib/mongoid/attributes.rb +30 -108
  10. data/lib/mongoid/attributes/dynamic.rb +154 -0
  11. data/lib/mongoid/attributes/nested.rb +82 -0
  12. data/lib/mongoid/attributes/processing.rb +13 -66
  13. data/lib/mongoid/{dirty.rb → changeable.rb} +5 -2
  14. data/lib/mongoid/composable.rb +104 -0
  15. data/lib/mongoid/config.rb +3 -9
  16. data/lib/mongoid/config/options.rb +1 -1
  17. data/lib/mongoid/contextual/aggregable/mongo.rb +5 -9
  18. data/lib/mongoid/contextual/atomic.rb +53 -53
  19. data/lib/mongoid/contextual/command.rb +26 -0
  20. data/lib/mongoid/contextual/map_reduce.rb +1 -1
  21. data/lib/mongoid/contextual/memory.rb +6 -5
  22. data/lib/mongoid/contextual/mongo.rb +59 -28
  23. data/lib/mongoid/contextual/text_search.rb +180 -0
  24. data/lib/mongoid/copyable.rb +2 -3
  25. data/lib/mongoid/criteria.rb +13 -33
  26. data/lib/mongoid/criteria/{#findable.rb# → findable.rb} +0 -2
  27. data/lib/mongoid/{criterion/inspection.rb → criteria/inspectable.rb} +2 -2
  28. data/lib/mongoid/{criterion → criteria}/marshalable.rb +3 -1
  29. data/lib/mongoid/{criterion → criteria}/modifiable.rb +1 -1
  30. data/lib/mongoid/{criterion/scoping.rb → criteria/scopable.rb} +2 -2
  31. data/lib/mongoid/document.rb +28 -12
  32. data/lib/mongoid/errors.rb +1 -1
  33. data/lib/mongoid/errors/document_not_found.rb +2 -1
  34. data/lib/mongoid/errors/invalid_value.rb +16 -0
  35. data/lib/mongoid/errors/mongoid_error.rb +1 -1
  36. data/lib/mongoid/extensions.rb +2 -7
  37. data/lib/mongoid/extensions/array.rb +2 -2
  38. data/lib/mongoid/extensions/boolean.rb +14 -17
  39. data/lib/mongoid/extensions/float.rb +1 -0
  40. data/lib/mongoid/extensions/hash.rb +1 -1
  41. data/lib/mongoid/extensions/object.rb +4 -4
  42. data/lib/mongoid/extensions/object_id.rb +5 -5
  43. data/lib/mongoid/extensions/range.rb +8 -2
  44. data/lib/mongoid/extensions/string.rb +5 -17
  45. data/lib/mongoid/extensions/time.rb +2 -2
  46. data/lib/mongoid/factory.rb +3 -3
  47. data/lib/mongoid/fields.rb +9 -8
  48. data/lib/mongoid/fields/foreign_key.rb +3 -3
  49. data/lib/mongoid/fields/standard.rb +4 -16
  50. data/lib/mongoid/fields/validators/macro.rb +11 -3
  51. data/lib/mongoid/{finders.rb → findable.rb} +6 -2
  52. data/lib/mongoid/{indexes.rb → indexable.rb} +50 -55
  53. data/lib/mongoid/indexable/specification.rb +104 -0
  54. data/lib/mongoid/{indexes → indexable}/validators/options.rb +2 -1
  55. data/lib/mongoid/{inspection.rb → inspectable.rb} +15 -11
  56. data/lib/mongoid/{callbacks.rb → interceptable.rb} +3 -52
  57. data/lib/mongoid/log_subscriber.rb +22 -0
  58. data/lib/mongoid/matchable.rb +152 -0
  59. data/lib/mongoid/{matchers → matchable}/all.rb +1 -1
  60. data/lib/mongoid/{matchers → matchable}/and.rb +2 -2
  61. data/lib/mongoid/{matchers → matchable}/default.rb +1 -1
  62. data/lib/mongoid/{matchers → matchable}/exists.rb +1 -1
  63. data/lib/mongoid/{matchers → matchable}/gt.rb +1 -1
  64. data/lib/mongoid/{matchers → matchable}/gte.rb +1 -1
  65. data/lib/mongoid/{matchers → matchable}/in.rb +2 -2
  66. data/lib/mongoid/{matchers → matchable}/lt.rb +1 -1
  67. data/lib/mongoid/{matchers → matchable}/lte.rb +1 -1
  68. data/lib/mongoid/{matchers → matchable}/ne.rb +1 -1
  69. data/lib/mongoid/{matchers → matchable}/nin.rb +3 -2
  70. data/lib/mongoid/{matchers → matchable}/or.rb +2 -2
  71. data/lib/mongoid/{matchers → matchable}/size.rb +1 -1
  72. data/lib/mongoid/persistable.rb +212 -0
  73. data/lib/mongoid/persistable/creatable.rb +188 -0
  74. data/lib/mongoid/persistable/deletable.rb +148 -0
  75. data/lib/mongoid/persistable/destroyable.rb +55 -0
  76. data/lib/mongoid/persistable/incrementable.rb +36 -0
  77. data/lib/mongoid/persistable/logical.rb +38 -0
  78. data/lib/mongoid/persistable/poppable.rb +39 -0
  79. data/lib/mongoid/persistable/pullable.rb +55 -0
  80. data/lib/mongoid/persistable/pushable.rb +62 -0
  81. data/lib/mongoid/persistable/renamable.rb +35 -0
  82. data/lib/mongoid/persistable/savable.rb +52 -0
  83. data/lib/mongoid/persistable/settable.rb +33 -0
  84. data/lib/mongoid/persistable/unsettable.rb +36 -0
  85. data/lib/mongoid/persistable/updatable.rb +151 -0
  86. data/lib/mongoid/persistable/upsertable.rb +55 -0
  87. data/lib/mongoid/positional.rb +71 -0
  88. data/lib/mongoid/railtie.rb +32 -45
  89. data/lib/mongoid/railties/database.rake +12 -6
  90. data/lib/mongoid/relations.rb +3 -3
  91. data/lib/mongoid/relations/accessors.rb +13 -46
  92. data/lib/mongoid/relations/auto_save.rb +15 -36
  93. data/lib/mongoid/relations/binding.rb +0 -23
  94. data/lib/mongoid/relations/bindings/embedded/many.rb +1 -3
  95. data/lib/mongoid/relations/bindings/referenced/in.rb +3 -8
  96. data/lib/mongoid/relations/bindings/referenced/many_to_many.rb +3 -1
  97. data/lib/mongoid/relations/builder.rb +1 -1
  98. data/lib/mongoid/relations/builders.rb +2 -2
  99. data/lib/mongoid/relations/builders/nested_attributes/many.rb +10 -13
  100. data/lib/mongoid/relations/builders/nested_attributes/one.rb +4 -5
  101. data/lib/mongoid/relations/builders/referenced/in.rb +1 -1
  102. data/lib/mongoid/relations/builders/referenced/many.rb +1 -2
  103. data/lib/mongoid/relations/builders/referenced/many_to_many.rb +1 -2
  104. data/lib/mongoid/relations/builders/referenced/one.rb +1 -1
  105. data/lib/mongoid/relations/cascading.rb +3 -5
  106. data/lib/mongoid/relations/constraint.rb +1 -1
  107. data/lib/mongoid/relations/conversions.rb +1 -1
  108. data/lib/mongoid/relations/counter_cache.rb +39 -15
  109. data/lib/mongoid/relations/eager.rb +47 -0
  110. data/lib/mongoid/relations/eager/base.rb +57 -0
  111. data/lib/mongoid/relations/eager/belongs_to.rb +30 -0
  112. data/lib/mongoid/relations/eager/has_and_belongs_to_many.rb +40 -0
  113. data/lib/mongoid/relations/eager/has_many.rb +37 -0
  114. data/lib/mongoid/relations/eager/has_one.rb +29 -0
  115. data/lib/mongoid/relations/embedded/batchable.rb +3 -4
  116. data/lib/mongoid/relations/embedded/many.rb +7 -27
  117. data/lib/mongoid/relations/macros.rb +2 -4
  118. data/lib/mongoid/relations/many.rb +30 -31
  119. data/lib/mongoid/relations/metadata.rb +6 -75
  120. data/lib/mongoid/relations/nested_builder.rb +2 -2
  121. data/lib/mongoid/relations/options.rb +1 -0
  122. data/lib/mongoid/relations/polymorphic.rb +0 -1
  123. data/lib/mongoid/relations/proxy.rb +10 -32
  124. data/lib/mongoid/relations/referenced/in.rb +2 -18
  125. data/lib/mongoid/relations/referenced/many.rb +9 -22
  126. data/lib/mongoid/relations/referenced/many_to_many.rb +10 -33
  127. data/lib/mongoid/relations/referenced/one.rb +2 -21
  128. data/lib/mongoid/relations/synchronization.rb +3 -3
  129. data/lib/mongoid/relations/touchable.rb +33 -0
  130. data/lib/mongoid/{reloading.rb → reloadable.rb} +6 -4
  131. data/lib/mongoid/{scoping.rb → scopable.rb} +26 -3
  132. data/lib/mongoid/selectable.rb +59 -0
  133. data/lib/mongoid/{serialization.rb → serializable.rb} +10 -1
  134. data/lib/mongoid/sessions.rb +37 -345
  135. data/lib/mongoid/sessions/factory.rb +2 -0
  136. data/lib/mongoid/sessions/options.rb +176 -0
  137. data/lib/mongoid/sessions/storage_options.rb +140 -0
  138. data/lib/mongoid/sessions/thread_options.rb +19 -0
  139. data/lib/mongoid/sessions/validators/storage.rb +15 -1
  140. data/lib/mongoid/{sharding.rb → shardable.rb} +5 -1
  141. data/lib/mongoid/support/query_counter.rb +23 -0
  142. data/lib/mongoid/threaded.rb +0 -110
  143. data/lib/mongoid/threaded/lifecycle.rb +0 -28
  144. data/lib/mongoid/timestamps/updated/short.rb +2 -2
  145. data/lib/mongoid/{hierarchy.rb → traversable.rb} +9 -5
  146. data/lib/mongoid/{validations.rb → validatable.rb} +23 -9
  147. data/lib/mongoid/{validations → validatable}/associated.rb +3 -1
  148. data/lib/mongoid/{validations → validatable}/format.rb +1 -1
  149. data/lib/mongoid/{validations → validatable}/length.rb +1 -1
  150. data/lib/mongoid/{validations → validatable}/localizable.rb +1 -1
  151. data/lib/mongoid/{validations → validatable}/macros.rb +4 -3
  152. data/lib/mongoid/{validations → validatable}/presence.rb +1 -1
  153. data/lib/mongoid/{validations → validatable}/queryable.rb +1 -2
  154. data/lib/mongoid/{validations → validatable}/uniqueness.rb +3 -3
  155. data/lib/mongoid/version.rb +1 -1
  156. data/lib/rails/generators/mongoid/config/templates/mongoid.yml +9 -13
  157. data/lib/rails/generators/mongoid/model/model_generator.rb +0 -1
  158. data/lib/rails/generators/mongoid/model/templates/model.rb.tt +0 -3
  159. data/lib/rails/generators/mongoid_generator.rb +3 -40
  160. data/lib/rails/mongoid.rb +59 -57
  161. data/lib/support/ruby_version.rb +1 -1
  162. data/spec/app/models/account.rb +2 -6
  163. data/spec/app/models/acolyte.rb +1 -0
  164. data/spec/app/models/actor.rb +0 -1
  165. data/spec/app/models/address.rb +6 -1
  166. data/spec/app/models/animal.rb +1 -1
  167. data/spec/app/models/appointment.rb +2 -2
  168. data/spec/app/models/article.rb +1 -4
  169. data/spec/app/models/audio.rb +5 -0
  170. data/spec/app/models/author.rb +0 -2
  171. data/spec/app/models/band.rb +3 -2
  172. data/spec/app/models/bar.rb +1 -0
  173. data/spec/app/models/book.rb +1 -0
  174. data/spec/app/models/building.rb +0 -2
  175. data/spec/app/models/building_address.rb +0 -2
  176. data/spec/app/models/bus.rb +1 -1
  177. data/spec/app/models/canvas.rb +1 -1
  178. data/spec/app/models/contractor.rb +0 -2
  179. data/spec/app/models/country_code.rb +1 -1
  180. data/spec/app/models/definition.rb +2 -2
  181. data/spec/app/models/dragon.rb +4 -0
  182. data/spec/app/models/drug.rb +1 -3
  183. data/spec/app/models/dungeon.rb +4 -0
  184. data/spec/app/models/filesystem.rb +1 -0
  185. data/spec/app/models/fish.rb +0 -1
  186. data/spec/app/models/fruits.rb +6 -0
  187. data/spec/app/models/game.rb +0 -2
  188. data/spec/app/models/house.rb +0 -2
  189. data/spec/app/models/item.rb +1 -5
  190. data/spec/app/models/jar.rb +1 -1
  191. data/spec/app/models/label.rb +4 -4
  192. data/spec/app/models/login.rb +1 -1
  193. data/spec/app/models/movie.rb +1 -0
  194. data/spec/app/models/name.rb +3 -3
  195. data/spec/app/models/note.rb +1 -1
  196. data/spec/app/models/oscar.rb +1 -1
  197. data/spec/app/models/parent_doc.rb +1 -1
  198. data/spec/app/models/person.rb +13 -8
  199. data/spec/app/models/phone.rb +1 -3
  200. data/spec/app/models/player.rb +1 -1
  201. data/spec/app/models/post.rb +2 -1
  202. data/spec/app/models/quiz.rb +0 -3
  203. data/spec/app/models/record.rb +5 -5
  204. data/spec/app/models/registry.rb +1 -1
  205. data/spec/app/models/server.rb +1 -1
  206. data/spec/app/models/service.rb +3 -3
  207. data/spec/app/models/sound.rb +5 -0
  208. data/spec/app/models/template.rb +1 -1
  209. data/spec/app/models/title.rb +0 -1
  210. data/spec/app/models/track.rb +5 -5
  211. data/spec/app/models/tree.rb +1 -1
  212. data/spec/app/models/video.rb +0 -4
  213. data/spec/app/models/wiki_page.rb +1 -4
  214. data/spec/app/models/word.rb +3 -0
  215. data/spec/app/models/word_origin.rb +1 -1
  216. data/spec/config/mongoid.yml +7 -8
  217. data/spec/helpers.rb +18 -0
  218. data/spec/mongoid/atomic/modifiers_spec.rb +22 -22
  219. data/spec/mongoid/atomic/paths/embedded/many_spec.rb +8 -49
  220. data/spec/mongoid/atomic/paths/embedded/one_spec.rb +7 -49
  221. data/spec/mongoid/atomic/paths/root_spec.rb +3 -61
  222. data/spec/mongoid/atomic/paths_spec.rb +19 -19
  223. data/spec/mongoid/atomic_spec.rb +19 -19
  224. data/spec/mongoid/{nested_attributes_spec.rb → attributes/nested_spec.rb} +335 -448
  225. data/spec/mongoid/attributes/readonly_spec.rb +16 -16
  226. data/spec/mongoid/attributes_spec.rb +188 -434
  227. data/spec/mongoid/{dirty_spec.rb → changeable_spec.rb} +117 -148
  228. data/spec/mongoid/{components_spec.rb → composable_spec.rb} +3 -3
  229. data/spec/mongoid/config/environment_spec.rb +3 -3
  230. data/spec/mongoid/config/options_spec.rb +6 -6
  231. data/spec/mongoid/config_spec.rb +24 -48
  232. data/spec/mongoid/contextual/aggregable/memory_spec.rb +12 -12
  233. data/spec/mongoid/contextual/aggregable/mongo_spec.rb +46 -38
  234. data/spec/mongoid/contextual/atomic_spec.rb +60 -56
  235. data/spec/mongoid/contextual/find_and_modify_spec.rb +14 -14
  236. data/spec/mongoid/contextual/geo_near_spec.rb +22 -22
  237. data/spec/mongoid/contextual/map_reduce_spec.rb +27 -27
  238. data/spec/mongoid/contextual/memory_spec.rb +94 -94
  239. data/spec/mongoid/contextual/mongo_spec.rb +225 -139
  240. data/spec/mongoid/contextual/text_search_spec.rb +207 -0
  241. data/spec/mongoid/copyable_spec.rb +56 -68
  242. data/spec/mongoid/criteria/findable_spec.rb +991 -0
  243. data/spec/mongoid/{criterion/inspection_spec.rb → criteria/inspectable_spec.rb} +5 -5
  244. data/spec/mongoid/{criterion → criteria}/marshalable_spec.rb +2 -2
  245. data/spec/mongoid/criteria/modifiable_spec.rb +1063 -0
  246. data/spec/mongoid/{criterion/scoping_spec.rb → criteria/scopable_spec.rb} +31 -31
  247. data/spec/mongoid/criteria_spec.rb +530 -2207
  248. data/spec/mongoid/document_spec.rb +166 -120
  249. data/spec/mongoid/equality_spec.rb +22 -22
  250. data/spec/mongoid/errors/ambiguous_relationship_spec.rb +3 -3
  251. data/spec/mongoid/errors/callback_spec.rb +3 -3
  252. data/spec/mongoid/errors/delete_restriction_spec.rb +3 -3
  253. data/spec/mongoid/errors/document_not_found_spec.rb +11 -11
  254. data/spec/mongoid/errors/eager_load_spec.rb +3 -3
  255. data/spec/mongoid/errors/invalid_collection_spec.rb +3 -3
  256. data/spec/mongoid/errors/invalid_config_option_spec.rb +3 -3
  257. data/spec/mongoid/errors/invalid_field_option_spec.rb +3 -3
  258. data/spec/mongoid/errors/invalid_field_spec.rb +3 -3
  259. data/spec/mongoid/errors/invalid_find_spec.rb +3 -3
  260. data/spec/mongoid/errors/invalid_includes_spec.rb +3 -3
  261. data/spec/mongoid/errors/invalid_index_spec.rb +3 -3
  262. data/spec/mongoid/errors/invalid_options_spec.rb +3 -3
  263. data/spec/mongoid/errors/invalid_path_spec.rb +3 -3
  264. data/spec/mongoid/errors/invalid_scope_spec.rb +3 -3
  265. data/spec/mongoid/errors/invalid_set_polymorphic_relation_spec.rb +3 -3
  266. data/spec/mongoid/errors/invalid_storage_options_spec.rb +3 -3
  267. data/spec/mongoid/errors/invalid_time_spec.rb +3 -3
  268. data/spec/mongoid/errors/inverse_not_found_spec.rb +3 -3
  269. data/spec/mongoid/errors/mixed_relations_spec.rb +3 -3
  270. data/spec/mongoid/errors/mixed_session_configuration_spec.rb +3 -3
  271. data/spec/mongoid/errors/mongoid_error_spec.rb +7 -7
  272. data/spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb +3 -3
  273. data/spec/mongoid/errors/no_environment_spec.rb +3 -3
  274. data/spec/mongoid/errors/no_map_reduce_output_spec.rb +3 -3
  275. data/spec/mongoid/errors/no_metadata_spec.rb +3 -3
  276. data/spec/mongoid/errors/no_parent_spec.rb +3 -3
  277. data/spec/mongoid/errors/no_session_config_spec.rb +3 -3
  278. data/spec/mongoid/errors/no_session_database_spec.rb +3 -3
  279. data/spec/mongoid/errors/no_session_hosts_spec.rb +3 -3
  280. data/spec/mongoid/errors/no_sessions_config_spec.rb +3 -3
  281. data/spec/mongoid/errors/readonly_attribute_spec.rb +3 -3
  282. data/spec/mongoid/errors/scope_overwrite_spec.rb +3 -3
  283. data/spec/mongoid/errors/too_many_nested_attribute_records_spec.rb +3 -3
  284. data/spec/mongoid/errors/unknown_attribute_spec.rb +5 -5
  285. data/spec/mongoid/errors/unsaved_document_spec.rb +3 -3
  286. data/spec/mongoid/errors/unsupported_javascript_spec.rb +3 -3
  287. data/spec/mongoid/errors/validations_spec.rb +7 -7
  288. data/spec/mongoid/extensions/array_spec.rb +61 -61
  289. data/spec/mongoid/extensions/big_decimal_spec.rb +11 -11
  290. data/spec/mongoid/extensions/binary_spec.rb +12 -12
  291. data/spec/mongoid/extensions/boolean_spec.rb +18 -18
  292. data/spec/mongoid/extensions/date_spec.rb +13 -13
  293. data/spec/mongoid/extensions/date_time_spec.rb +9 -9
  294. data/spec/mongoid/extensions/false_class_spec.rb +5 -5
  295. data/spec/mongoid/extensions/float_spec.rb +29 -15
  296. data/spec/mongoid/extensions/hash_spec.rb +29 -29
  297. data/spec/mongoid/extensions/integer_spec.rb +15 -15
  298. data/spec/mongoid/extensions/module_spec.rb +2 -2
  299. data/spec/mongoid/extensions/nil_class_spec.rb +1 -1
  300. data/spec/mongoid/extensions/object_id_spec.rb +134 -134
  301. data/spec/mongoid/extensions/object_spec.rb +26 -26
  302. data/spec/mongoid/extensions/range_spec.rb +61 -12
  303. data/spec/mongoid/extensions/regexp_spec.rb +4 -4
  304. data/spec/mongoid/extensions/set_spec.rb +4 -4
  305. data/spec/mongoid/extensions/string_spec.rb +35 -46
  306. data/spec/mongoid/extensions/symbol_spec.rb +9 -9
  307. data/spec/mongoid/extensions/time_spec.rb +49 -49
  308. data/spec/mongoid/extensions/time_with_zone_spec.rb +34 -34
  309. data/spec/mongoid/extensions/true_class_spec.rb +5 -5
  310. data/spec/mongoid/extensions_spec.rb +15 -0
  311. data/spec/mongoid/factory_spec.rb +15 -15
  312. data/spec/mongoid/fields/foreign_key_spec.rb +73 -66
  313. data/spec/mongoid/fields/internal/foreign_keys/array_spec.rb +15 -15
  314. data/spec/mongoid/fields/internal/foreign_keys/object_spec.rb +22 -22
  315. data/spec/mongoid/fields/localized_spec.rb +23 -23
  316. data/spec/mongoid/fields/standard_spec.rb +12 -12
  317. data/spec/mongoid/fields_spec.rb +168 -209
  318. data/spec/mongoid/{finders_spec.rb → findable_spec.rb} +62 -27
  319. data/spec/mongoid/indexable/specification_spec.rb +102 -0
  320. data/spec/mongoid/{indexes_spec.rb → indexable_spec.rb} +171 -51
  321. data/spec/mongoid/{inspection_spec.rb → inspectable_spec.rb} +6 -14
  322. data/spec/mongoid/{callbacks_spec.rb → interceptable_spec.rb} +105 -105
  323. data/spec/mongoid/log_subscriber_spec.rb +74 -0
  324. data/spec/mongoid/loggable_spec.rb +1 -1
  325. data/spec/mongoid/{matchers → matchable}/all_spec.rb +4 -4
  326. data/spec/mongoid/{matchers → matchable}/and_spec.rb +11 -11
  327. data/spec/mongoid/{matchers → matchable}/default_spec.rb +15 -15
  328. data/spec/mongoid/{matchers → matchable}/exists_spec.rb +5 -5
  329. data/spec/mongoid/{matchers → matchable}/gt_spec.rb +9 -8
  330. data/spec/mongoid/{matchers → matchable}/gte_spec.rb +7 -7
  331. data/spec/mongoid/matchable/in_spec.rb +49 -0
  332. data/spec/mongoid/{matchers → matchable}/lt_spec.rb +7 -7
  333. data/spec/mongoid/{matchers → matchable}/lte_spec.rb +7 -7
  334. data/spec/mongoid/{matchers → matchable}/ne_spec.rb +3 -3
  335. data/spec/mongoid/matchable/nin_spec.rb +48 -0
  336. data/spec/mongoid/{matchers → matchable}/or_spec.rb +6 -6
  337. data/spec/mongoid/{matchers → matchable}/size_spec.rb +3 -3
  338. data/spec/mongoid/{matchers_spec.rb → matchable_spec.rb} +41 -41
  339. data/spec/mongoid/persistable/creatable_spec.rb +512 -0
  340. data/spec/mongoid/persistable/deletable_spec.rb +205 -0
  341. data/spec/mongoid/persistable/destroyable_spec.rb +148 -0
  342. data/spec/mongoid/persistable/incrementable_spec.rb +173 -0
  343. data/spec/mongoid/persistable/logical_spec.rb +143 -0
  344. data/spec/mongoid/persistable/poppable_spec.rb +115 -0
  345. data/spec/mongoid/persistable/pullable_spec.rb +228 -0
  346. data/spec/mongoid/persistable/pushable_spec.rb +258 -0
  347. data/spec/mongoid/persistable/renamable_spec.rb +135 -0
  348. data/spec/mongoid/persistable/savable_spec.rb +432 -0
  349. data/spec/mongoid/persistable/settable_spec.rb +139 -0
  350. data/spec/mongoid/persistable/unsettable_spec.rb +155 -0
  351. data/spec/mongoid/persistable/updatable_spec.rb +558 -0
  352. data/spec/mongoid/persistable/upsertable_spec.rb +106 -0
  353. data/spec/mongoid/persistable_spec.rb +206 -0
  354. data/spec/mongoid/{atomic/positionable_spec.rb → positional_spec.rb} +19 -14
  355. data/spec/mongoid/railties/document_spec.rb +2 -2
  356. data/spec/mongoid/relations/accessors_spec.rb +53 -145
  357. data/spec/mongoid/relations/auto_save_spec.rb +36 -16
  358. data/spec/mongoid/relations/bindings/embedded/in_spec.rb +6 -6
  359. data/spec/mongoid/relations/bindings/embedded/many_spec.rb +2 -2
  360. data/spec/mongoid/relations/bindings/embedded/one_spec.rb +3 -3
  361. data/spec/mongoid/relations/bindings/referenced/in_spec.rb +12 -12
  362. data/spec/mongoid/relations/bindings/referenced/many_spec.rb +6 -6
  363. data/spec/mongoid/relations/bindings/referenced/many_to_many_spec.rb +9 -9
  364. data/spec/mongoid/relations/bindings/referenced/one_spec.rb +6 -6
  365. data/spec/mongoid/relations/builders/embedded/in_spec.rb +4 -4
  366. data/spec/mongoid/relations/builders/embedded/many_spec.rb +18 -18
  367. data/spec/mongoid/relations/builders/embedded/one_spec.rb +11 -11
  368. data/spec/mongoid/relations/builders/nested_attributes/many_spec.rb +12 -13
  369. data/spec/mongoid/relations/builders/nested_attributes/one_spec.rb +14 -14
  370. data/spec/mongoid/relations/builders/referenced/in_spec.rb +22 -33
  371. data/spec/mongoid/relations/builders/referenced/many_spec.rb +15 -15
  372. data/spec/mongoid/relations/builders/referenced/many_to_many_spec.rb +18 -18
  373. data/spec/mongoid/relations/builders/referenced/one_spec.rb +11 -24
  374. data/spec/mongoid/relations/builders_spec.rb +21 -21
  375. data/spec/mongoid/relations/cascading/delete_spec.rb +7 -7
  376. data/spec/mongoid/relations/cascading/destroy_spec.rb +2 -2
  377. data/spec/mongoid/relations/cascading/nullify_spec.rb +2 -2
  378. data/spec/mongoid/relations/cascading/restrict_spec.rb +3 -3
  379. data/spec/mongoid/relations/cascading_spec.rb +16 -16
  380. data/spec/mongoid/relations/constraint_spec.rb +8 -7
  381. data/spec/mongoid/relations/conversions_spec.rb +16 -14
  382. data/spec/mongoid/relations/counter_cache_spec.rb +85 -0
  383. data/spec/mongoid/relations/cyclic_spec.rb +18 -18
  384. data/spec/mongoid/relations/eager/belongs_to_spec.rb +154 -0
  385. data/spec/mongoid/relations/eager/has_and_belongs_to_many_spec.rb +143 -0
  386. data/spec/mongoid/relations/eager/has_many_spec.rb +207 -0
  387. data/spec/mongoid/relations/eager/has_one_spec.rb +163 -0
  388. data/spec/mongoid/relations/eager_spec.rb +228 -0
  389. data/spec/mongoid/relations/embedded/dirty_spec.rb +8 -8
  390. data/spec/mongoid/relations/embedded/in_spec.rb +55 -56
  391. data/spec/mongoid/relations/embedded/many_spec.rb +357 -367
  392. data/spec/mongoid/relations/embedded/one_spec.rb +98 -139
  393. data/spec/mongoid/relations/macros_spec.rb +108 -102
  394. data/spec/mongoid/relations/metadata_spec.rb +147 -241
  395. data/spec/mongoid/relations/options_spec.rb +1 -1
  396. data/spec/mongoid/relations/polymorphic_spec.rb +13 -17
  397. data/spec/mongoid/relations/proxy_spec.rb +2 -2
  398. data/spec/mongoid/relations/referenced/in_spec.rb +128 -303
  399. data/spec/mongoid/relations/referenced/many_spec.rb +379 -522
  400. data/spec/mongoid/relations/referenced/many_to_many_spec.rb +345 -417
  401. data/spec/mongoid/relations/referenced/one_spec.rb +148 -263
  402. data/spec/mongoid/relations/reflections_spec.rb +6 -6
  403. data/spec/mongoid/relations/synchronization_spec.rb +46 -50
  404. data/spec/mongoid/relations/targets/enumerable_spec.rb +116 -116
  405. data/spec/mongoid/relations/touchable_spec.rb +296 -0
  406. data/spec/mongoid/relations_spec.rb +16 -15
  407. data/spec/mongoid/{reloading_spec.rb → reloadable_spec.rb} +20 -60
  408. data/spec/mongoid/{scoping_spec.rb → scopable_spec.rb} +74 -126
  409. data/spec/mongoid/selectable_spec.rb +134 -0
  410. data/spec/mongoid/{serialization_spec.rb → serializable_spec.rb} +111 -82
  411. data/spec/mongoid/sessions/factory_spec.rb +49 -28
  412. data/spec/mongoid/sessions/mongo_uri_spec.rb +7 -7
  413. data/spec/mongoid/sessions/options_spec.rb +92 -0
  414. data/spec/mongoid/sessions_spec.rb +288 -177
  415. data/spec/mongoid/{sharding_spec.rb → shardable_spec.rb} +8 -8
  416. data/spec/mongoid/state_spec.rb +10 -10
  417. data/spec/mongoid/threaded_spec.rb +17 -70
  418. data/spec/mongoid/timestamps/created/short_spec.rb +6 -6
  419. data/spec/mongoid/timestamps/created_spec.rb +5 -5
  420. data/spec/mongoid/timestamps/updated/short_spec.rb +10 -10
  421. data/spec/mongoid/timestamps/updated_spec.rb +8 -12
  422. data/spec/mongoid/timestamps_spec.rb +7 -11
  423. data/spec/mongoid/{hierarchy_spec.rb → traversable_spec.rb} +19 -19
  424. data/spec/mongoid/{validations → validatable}/associated_spec.rb +18 -18
  425. data/spec/mongoid/{validations → validatable}/format_spec.rb +6 -6
  426. data/spec/mongoid/{validations → validatable}/length_spec.rb +7 -7
  427. data/spec/mongoid/{validations → validatable}/numericality_spec.rb +1 -1
  428. data/spec/mongoid/{validations → validatable}/presence_spec.rb +31 -38
  429. data/spec/mongoid/{validations → validatable}/uniqueness_spec.rb +126 -183
  430. data/spec/mongoid/{validations_spec.rb → validatable_spec.rb} +28 -28
  431. data/spec/mongoid_spec.rb +8 -8
  432. data/spec/rails/mongoid_spec.rb +72 -87
  433. data/spec/spec_helper.rb +19 -17
  434. metadata +261 -283
  435. data/lib/mongoid/atomic/positionable.rb +0 -73
  436. data/lib/mongoid/components.rb +0 -92
  437. data/lib/mongoid/config/inflections.rb +0 -6
  438. data/lib/mongoid/contextual/eager.rb +0 -158
  439. data/lib/mongoid/criterion/findable.rb +0 -179
  440. data/lib/mongoid/errors/versioning_not_on_root.rb +0 -23
  441. data/lib/mongoid/identity_map.rb +0 -163
  442. data/lib/mongoid/json.rb +0 -16
  443. data/lib/mongoid/matchers.rb +0 -32
  444. data/lib/mongoid/matchers/strategies.rb +0 -97
  445. data/lib/mongoid/multi_parameter_attributes.rb +0 -105
  446. data/lib/mongoid/nested_attributes.rb +0 -78
  447. data/lib/mongoid/observer.rb +0 -192
  448. data/lib/mongoid/paranoia.rb +0 -136
  449. data/lib/mongoid/persistence.rb +0 -357
  450. data/lib/mongoid/persistence/atomic.rb +0 -231
  451. data/lib/mongoid/persistence/atomic/add_to_set.rb +0 -47
  452. data/lib/mongoid/persistence/atomic/bit.rb +0 -35
  453. data/lib/mongoid/persistence/atomic/inc.rb +0 -45
  454. data/lib/mongoid/persistence/atomic/operation.rb +0 -154
  455. data/lib/mongoid/persistence/atomic/pop.rb +0 -32
  456. data/lib/mongoid/persistence/atomic/pull.rb +0 -32
  457. data/lib/mongoid/persistence/atomic/pull_all.rb +0 -32
  458. data/lib/mongoid/persistence/atomic/push.rb +0 -25
  459. data/lib/mongoid/persistence/atomic/push_all.rb +0 -25
  460. data/lib/mongoid/persistence/atomic/rename.rb +0 -30
  461. data/lib/mongoid/persistence/atomic/sets.rb +0 -28
  462. data/lib/mongoid/persistence/atomic/unset.rb +0 -27
  463. data/lib/mongoid/persistence/deletion.rb +0 -31
  464. data/lib/mongoid/persistence/insertion.rb +0 -38
  465. data/lib/mongoid/persistence/modification.rb +0 -35
  466. data/lib/mongoid/persistence/operations.rb +0 -214
  467. data/lib/mongoid/persistence/operations/embedded/insert.rb +0 -46
  468. data/lib/mongoid/persistence/operations/embedded/remove.rb +0 -43
  469. data/lib/mongoid/persistence/operations/insert.rb +0 -34
  470. data/lib/mongoid/persistence/operations/remove.rb +0 -33
  471. data/lib/mongoid/persistence/operations/update.rb +0 -59
  472. data/lib/mongoid/persistence/operations/upsert.rb +0 -28
  473. data/lib/mongoid/persistence/upsertion.rb +0 -31
  474. data/lib/mongoid/unit_of_work.rb +0 -61
  475. data/lib/mongoid/versioning.rb +0 -217
  476. data/lib/rack/mongoid.rb +0 -2
  477. data/lib/rack/mongoid/middleware/identity_map.rb +0 -39
  478. data/lib/rails/generators/mongoid/observer/observer_generator.rb +0 -17
  479. data/lib/rails/generators/mongoid/observer/templates/observer.rb.tt +0 -4
  480. data/spec/app/models/actor_observer.rb +0 -15
  481. data/spec/app/models/callback_recorder.rb +0 -25
  482. data/spec/app/models/draft.rb +0 -9
  483. data/spec/app/models/paranoid_phone.rb +0 -25
  484. data/spec/app/models/paranoid_post.rb +0 -36
  485. data/spec/app/models/phone_observer.rb +0 -6
  486. data/spec/mongoid/#atomic_spec.rb# +0 -365
  487. data/spec/mongoid/attributes/processing_spec.rb +0 -149
  488. data/spec/mongoid/criterion/destructive_spec.rb +0 -101
  489. data/spec/mongoid/criterion/modifiable_spec.rb +0 -409
  490. data/spec/mongoid/criterion/modification_spec.rb +0 -402
  491. data/spec/mongoid/errors/versioning_not_on_root_spec.rb +0 -29
  492. data/spec/mongoid/identity_map_spec.rb +0 -564
  493. data/spec/mongoid/json_spec.rb +0 -33
  494. data/spec/mongoid/matchers/in_spec.rb +0 -25
  495. data/spec/mongoid/matchers/nin_spec.rb +0 -25
  496. data/spec/mongoid/multi_parameter_attributes_spec.rb +0 -128
  497. data/spec/mongoid/observer_spec.rb +0 -290
  498. data/spec/mongoid/paranoia_spec.rb +0 -759
  499. data/spec/mongoid/persistence/atomic/add_to_set_spec.rb +0 -262
  500. data/spec/mongoid/persistence/atomic/bit_spec.rb +0 -88
  501. data/spec/mongoid/persistence/atomic/inc_spec.rb +0 -133
  502. data/spec/mongoid/persistence/atomic/pop_spec.rb +0 -111
  503. data/spec/mongoid/persistence/atomic/pull_all_spec.rb +0 -77
  504. data/spec/mongoid/persistence/atomic/pull_spec.rb +0 -80
  505. data/spec/mongoid/persistence/atomic/push_all_spec.rb +0 -77
  506. data/spec/mongoid/persistence/atomic/push_spec.rb +0 -77
  507. data/spec/mongoid/persistence/atomic/rename_spec.rb +0 -42
  508. data/spec/mongoid/persistence/atomic/sets_spec.rb +0 -154
  509. data/spec/mongoid/persistence/atomic/unset_spec.rb +0 -65
  510. data/spec/mongoid/persistence/atomic_spec.rb +0 -216
  511. data/spec/mongoid/persistence/operations/embedded/insert_spec.rb +0 -191
  512. data/spec/mongoid/persistence/operations/embedded/remove_spec.rb +0 -8
  513. data/spec/mongoid/persistence/operations/insert_spec.rb +0 -149
  514. data/spec/mongoid/persistence/operations/remove_spec.rb +0 -113
  515. data/spec/mongoid/persistence/operations/update_spec.rb +0 -141
  516. data/spec/mongoid/persistence/operations/upsert_spec.rb +0 -59
  517. data/spec/mongoid/persistence/operations_spec.rb +0 -313
  518. data/spec/mongoid/persistence_spec.rb +0 -2279
  519. data/spec/mongoid/unit_of_work_spec.rb +0 -196
  520. data/spec/mongoid/versioning_spec.rb +0 -540
  521. data/spec/rack/mongoid/middleware/identity_map_spec.rb +0 -72
@@ -4,8 +4,16 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
4
4
  MODELS = File.join(File.dirname(__FILE__), "app/models")
5
5
  $LOAD_PATH.unshift(MODELS)
6
6
 
7
+ if ENV["CI"]
8
+ require "coveralls"
9
+ Coveralls.wear! do
10
+ add_filter "spec"
11
+ end
12
+ end
13
+
7
14
  require "mongoid"
8
15
  require "rspec"
16
+ require "helpers"
9
17
 
10
18
  # These environment variables can be set if wanting to test against a database
11
19
  # that is not on the local machine.
@@ -45,9 +53,12 @@ def mongohq_connectable?
45
53
  ENV["MONGOHQ_REPL_PASS"].present?
46
54
  end
47
55
 
48
- def mongodb_version
56
+ def purge_database_alt!
49
57
  session = Mongoid::Sessions.default
50
- session.command(buildinfo: 1)["version"]
58
+ session.use(database_id_alt)
59
+ session.collections.each do |collection|
60
+ collection.drop
61
+ end
51
62
  end
52
63
 
53
64
  # Set the database that the spec suite connects to.
@@ -71,20 +82,17 @@ module MyApp
71
82
  end
72
83
  end
73
84
 
85
+ ActiveSupport::Inflector.inflections do |inflect|
86
+ inflect.irregular("canvas", "canvases")
87
+ inflect.singular("address_components", "address_component")
88
+ end
89
+
74
90
  RSpec.configure do |config|
91
+ config.include Mongoid::SpecHelpers
75
92
 
76
93
  # Drop all collections and clear the identity map before each spec.
77
94
  config.before(:each) do
78
95
  Mongoid.purge!
79
- Mongoid::IdentityMap.clear
80
- end
81
-
82
- # On travis we are creating many different databases on each test run. We
83
- # drop the database after the suite.
84
- config.after(:suite) do
85
- if ENV["CI"]
86
- Mongoid::Threaded.sessions[:default].drop
87
- end
88
96
  end
89
97
 
90
98
  # Filter out MongoHQ specs if we can't connect to it.
@@ -92,9 +100,3 @@ RSpec.configure do |config|
92
100
  return true if value == :mongohq && !mongohq_connectable?
93
101
  })
94
102
  end
95
-
96
- ActiveSupport::Inflector.inflections do |inflect|
97
- inflect.singular("address_components", "address_component")
98
- end
99
-
100
- I18n.enforce_available_locales = false
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 4.0.0.alpha1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Durran Jordan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-19 00:00:00.000000000 Z
11
+ date: 2013-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: 4.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tzinfo
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.29
33
+ version: 0.3.37
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.29
40
+ version: 0.3.37
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: moped
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '1.4'
47
+ version: 2.0.beta4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '1.4'
54
+ version: 2.0.beta4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: origin
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  description: Mongoid is an ODM (Object Document Mapper) Framework for MongoDB, written
@@ -74,56 +74,48 @@ executables: []
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
- - CHANGELOG.md
78
- - LICENSE
79
- - README.md
80
- - Rakefile
81
77
  - lib/config/locales/en.yml
82
- - lib/mongoid.rb
83
- - lib/mongoid/atomic.rb
84
78
  - lib/mongoid/atomic/modifiers.rb
85
- - lib/mongoid/atomic/paths.rb
86
- - lib/mongoid/atomic/paths/embedded.rb
87
79
  - lib/mongoid/atomic/paths/embedded/many.rb
88
80
  - lib/mongoid/atomic/paths/embedded/one.rb
81
+ - lib/mongoid/atomic/paths/embedded.rb
89
82
  - lib/mongoid/atomic/paths/root.rb
90
- - lib/mongoid/atomic/positionable.rb
91
- - lib/mongoid/attributes.rb
83
+ - lib/mongoid/atomic/paths.rb
84
+ - lib/mongoid/atomic.rb
85
+ - lib/mongoid/attributes/dynamic.rb
86
+ - lib/mongoid/attributes/nested.rb
92
87
  - lib/mongoid/attributes/processing.rb
93
88
  - lib/mongoid/attributes/readonly.rb
94
- - lib/mongoid/callbacks.rb
95
- - lib/mongoid/components.rb
96
- - lib/mongoid/config.rb
89
+ - lib/mongoid/attributes.rb
90
+ - lib/mongoid/changeable.rb
91
+ - lib/mongoid/composable.rb
97
92
  - lib/mongoid/config/environment.rb
98
- - lib/mongoid/config/inflections.rb
99
93
  - lib/mongoid/config/options.rb
100
- - lib/mongoid/config/validators.rb
101
94
  - lib/mongoid/config/validators/option.rb
102
95
  - lib/mongoid/config/validators/session.rb
103
- - lib/mongoid/contextual.rb
96
+ - lib/mongoid/config/validators.rb
97
+ - lib/mongoid/config.rb
104
98
  - lib/mongoid/contextual/aggregable/memory.rb
105
99
  - lib/mongoid/contextual/aggregable/mongo.rb
106
100
  - lib/mongoid/contextual/atomic.rb
107
101
  - lib/mongoid/contextual/command.rb
108
- - lib/mongoid/contextual/eager.rb
109
102
  - lib/mongoid/contextual/find_and_modify.rb
110
103
  - lib/mongoid/contextual/geo_near.rb
111
104
  - lib/mongoid/contextual/map_reduce.rb
112
105
  - lib/mongoid/contextual/memory.rb
113
106
  - lib/mongoid/contextual/mongo.rb
114
107
  - lib/mongoid/contextual/queryable.rb
108
+ - lib/mongoid/contextual/text_search.rb
109
+ - lib/mongoid/contextual.rb
115
110
  - lib/mongoid/copyable.rb
111
+ - lib/mongoid/criteria/findable.rb
112
+ - lib/mongoid/criteria/inspectable.rb
113
+ - lib/mongoid/criteria/marshalable.rb
114
+ - lib/mongoid/criteria/modifiable.rb
115
+ - lib/mongoid/criteria/scopable.rb
116
116
  - lib/mongoid/criteria.rb
117
- - lib/mongoid/criteria/#findable.rb#
118
- - lib/mongoid/criterion/findable.rb
119
- - lib/mongoid/criterion/inspection.rb
120
- - lib/mongoid/criterion/marshalable.rb
121
- - lib/mongoid/criterion/modifiable.rb
122
- - lib/mongoid/criterion/scoping.rb
123
- - lib/mongoid/dirty.rb
124
117
  - lib/mongoid/document.rb
125
118
  - lib/mongoid/equality.rb
126
- - lib/mongoid/errors.rb
127
119
  - lib/mongoid/errors/ambiguous_relationship.rb
128
120
  - lib/mongoid/errors/callback.rb
129
121
  - lib/mongoid/errors/delete_restriction.rb
@@ -142,6 +134,7 @@ files:
142
134
  - lib/mongoid/errors/invalid_set_polymorphic_relation.rb
143
135
  - lib/mongoid/errors/invalid_storage_options.rb
144
136
  - lib/mongoid/errors/invalid_time.rb
137
+ - lib/mongoid/errors/invalid_value.rb
145
138
  - lib/mongoid/errors/inverse_not_found.rb
146
139
  - lib/mongoid/errors/mixed_relations.rb
147
140
  - lib/mongoid/errors/mixed_session_configuration.rb
@@ -163,9 +156,8 @@ files:
163
156
  - lib/mongoid/errors/unsaved_document.rb
164
157
  - lib/mongoid/errors/unsupported_javascript.rb
165
158
  - lib/mongoid/errors/validations.rb
166
- - lib/mongoid/errors/versioning_not_on_root.rb
159
+ - lib/mongoid/errors.rb
167
160
  - lib/mongoid/evolvable.rb
168
- - lib/mongoid/extensions.rb
169
161
  - lib/mongoid/extensions/array.rb
170
162
  - lib/mongoid/extensions/big_decimal.rb
171
163
  - lib/mongoid/extensions/boolean.rb
@@ -187,73 +179,58 @@ files:
187
179
  - lib/mongoid/extensions/time.rb
188
180
  - lib/mongoid/extensions/time_with_zone.rb
189
181
  - lib/mongoid/extensions/true_class.rb
182
+ - lib/mongoid/extensions.rb
190
183
  - lib/mongoid/factory.rb
191
- - lib/mongoid/fields.rb
192
184
  - lib/mongoid/fields/foreign_key.rb
193
185
  - lib/mongoid/fields/localized.rb
194
186
  - lib/mongoid/fields/standard.rb
195
- - lib/mongoid/fields/validators.rb
196
187
  - lib/mongoid/fields/validators/macro.rb
197
- - lib/mongoid/finders.rb
198
- - lib/mongoid/hierarchy.rb
199
- - lib/mongoid/identity_map.rb
200
- - lib/mongoid/indexes.rb
201
- - lib/mongoid/indexes/validators/options.rb
202
- - lib/mongoid/inspection.rb
203
- - lib/mongoid/json.rb
188
+ - lib/mongoid/fields/validators.rb
189
+ - lib/mongoid/fields.rb
190
+ - lib/mongoid/findable.rb
191
+ - lib/mongoid/indexable/specification.rb
192
+ - lib/mongoid/indexable/validators/options.rb
193
+ - lib/mongoid/indexable.rb
194
+ - lib/mongoid/inspectable.rb
195
+ - lib/mongoid/interceptable.rb
196
+ - lib/mongoid/log_subscriber.rb
204
197
  - lib/mongoid/loggable.rb
205
- - lib/mongoid/matchers.rb
206
- - lib/mongoid/matchers/all.rb
207
- - lib/mongoid/matchers/and.rb
208
- - lib/mongoid/matchers/default.rb
209
- - lib/mongoid/matchers/exists.rb
210
- - lib/mongoid/matchers/gt.rb
211
- - lib/mongoid/matchers/gte.rb
212
- - lib/mongoid/matchers/in.rb
213
- - lib/mongoid/matchers/lt.rb
214
- - lib/mongoid/matchers/lte.rb
215
- - lib/mongoid/matchers/ne.rb
216
- - lib/mongoid/matchers/nin.rb
217
- - lib/mongoid/matchers/or.rb
218
- - lib/mongoid/matchers/size.rb
219
- - lib/mongoid/matchers/strategies.rb
220
- - lib/mongoid/multi_parameter_attributes.rb
221
- - lib/mongoid/nested_attributes.rb
222
- - lib/mongoid/observer.rb
223
- - lib/mongoid/paranoia.rb
224
- - lib/mongoid/persistence.rb
225
- - lib/mongoid/persistence/atomic.rb
226
- - lib/mongoid/persistence/atomic/add_to_set.rb
227
- - lib/mongoid/persistence/atomic/bit.rb
228
- - lib/mongoid/persistence/atomic/inc.rb
229
- - lib/mongoid/persistence/atomic/operation.rb
230
- - lib/mongoid/persistence/atomic/pop.rb
231
- - lib/mongoid/persistence/atomic/pull.rb
232
- - lib/mongoid/persistence/atomic/pull_all.rb
233
- - lib/mongoid/persistence/atomic/push.rb
234
- - lib/mongoid/persistence/atomic/push_all.rb
235
- - lib/mongoid/persistence/atomic/rename.rb
236
- - lib/mongoid/persistence/atomic/sets.rb
237
- - lib/mongoid/persistence/atomic/unset.rb
238
- - lib/mongoid/persistence/deletion.rb
239
- - lib/mongoid/persistence/insertion.rb
240
- - lib/mongoid/persistence/modification.rb
241
- - lib/mongoid/persistence/operations.rb
242
- - lib/mongoid/persistence/operations/embedded/insert.rb
243
- - lib/mongoid/persistence/operations/embedded/remove.rb
244
- - lib/mongoid/persistence/operations/insert.rb
245
- - lib/mongoid/persistence/operations/remove.rb
246
- - lib/mongoid/persistence/operations/update.rb
247
- - lib/mongoid/persistence/operations/upsert.rb
248
- - lib/mongoid/persistence/upsertion.rb
198
+ - lib/mongoid/matchable/all.rb
199
+ - lib/mongoid/matchable/and.rb
200
+ - lib/mongoid/matchable/default.rb
201
+ - lib/mongoid/matchable/exists.rb
202
+ - lib/mongoid/matchable/gt.rb
203
+ - lib/mongoid/matchable/gte.rb
204
+ - lib/mongoid/matchable/in.rb
205
+ - lib/mongoid/matchable/lt.rb
206
+ - lib/mongoid/matchable/lte.rb
207
+ - lib/mongoid/matchable/ne.rb
208
+ - lib/mongoid/matchable/nin.rb
209
+ - lib/mongoid/matchable/or.rb
210
+ - lib/mongoid/matchable/size.rb
211
+ - lib/mongoid/matchable.rb
212
+ - lib/mongoid/persistable/creatable.rb
213
+ - lib/mongoid/persistable/deletable.rb
214
+ - lib/mongoid/persistable/destroyable.rb
215
+ - lib/mongoid/persistable/incrementable.rb
216
+ - lib/mongoid/persistable/logical.rb
217
+ - lib/mongoid/persistable/poppable.rb
218
+ - lib/mongoid/persistable/pullable.rb
219
+ - lib/mongoid/persistable/pushable.rb
220
+ - lib/mongoid/persistable/renamable.rb
221
+ - lib/mongoid/persistable/savable.rb
222
+ - lib/mongoid/persistable/settable.rb
223
+ - lib/mongoid/persistable/unsettable.rb
224
+ - lib/mongoid/persistable/updatable.rb
225
+ - lib/mongoid/persistable/upsertable.rb
226
+ - lib/mongoid/persistable.rb
227
+ - lib/mongoid/positional.rb
249
228
  - lib/mongoid/railtie.rb
250
229
  - lib/mongoid/railties/database.rake
251
230
  - lib/mongoid/railties/document.rb
252
- - lib/mongoid/relations.rb
253
231
  - lib/mongoid/relations/accessors.rb
254
232
  - lib/mongoid/relations/auto_save.rb
255
233
  - lib/mongoid/relations/binding.rb
256
- - lib/mongoid/relations/bindings.rb
257
234
  - lib/mongoid/relations/bindings/embedded/in.rb
258
235
  - lib/mongoid/relations/bindings/embedded/many.rb
259
236
  - lib/mongoid/relations/bindings/embedded/one.rb
@@ -261,8 +238,8 @@ files:
261
238
  - lib/mongoid/relations/bindings/referenced/many.rb
262
239
  - lib/mongoid/relations/bindings/referenced/many_to_many.rb
263
240
  - lib/mongoid/relations/bindings/referenced/one.rb
241
+ - lib/mongoid/relations/bindings.rb
264
242
  - lib/mongoid/relations/builder.rb
265
- - lib/mongoid/relations/builders.rb
266
243
  - lib/mongoid/relations/builders/embedded/in.rb
267
244
  - lib/mongoid/relations/builders/embedded/many.rb
268
245
  - lib/mongoid/relations/builders/embedded/one.rb
@@ -272,15 +249,22 @@ files:
272
249
  - lib/mongoid/relations/builders/referenced/many.rb
273
250
  - lib/mongoid/relations/builders/referenced/many_to_many.rb
274
251
  - lib/mongoid/relations/builders/referenced/one.rb
275
- - lib/mongoid/relations/cascading.rb
252
+ - lib/mongoid/relations/builders.rb
276
253
  - lib/mongoid/relations/cascading/delete.rb
277
254
  - lib/mongoid/relations/cascading/destroy.rb
278
255
  - lib/mongoid/relations/cascading/nullify.rb
279
256
  - lib/mongoid/relations/cascading/restrict.rb
257
+ - lib/mongoid/relations/cascading.rb
280
258
  - lib/mongoid/relations/constraint.rb
281
259
  - lib/mongoid/relations/conversions.rb
282
260
  - lib/mongoid/relations/counter_cache.rb
283
261
  - lib/mongoid/relations/cyclic.rb
262
+ - lib/mongoid/relations/eager/base.rb
263
+ - lib/mongoid/relations/eager/belongs_to.rb
264
+ - lib/mongoid/relations/eager/has_and_belongs_to_many.rb
265
+ - lib/mongoid/relations/eager/has_many.rb
266
+ - lib/mongoid/relations/eager/has_one.rb
267
+ - lib/mongoid/relations/eager.rb
284
268
  - lib/mongoid/relations/embedded/batchable.rb
285
269
  - lib/mongoid/relations/embedded/in.rb
286
270
  - lib/mongoid/relations/embedded/many.rb
@@ -300,55 +284,60 @@ files:
300
284
  - lib/mongoid/relations/referenced/one.rb
301
285
  - lib/mongoid/relations/reflections.rb
302
286
  - lib/mongoid/relations/synchronization.rb
303
- - lib/mongoid/relations/targets.rb
304
287
  - lib/mongoid/relations/targets/enumerable.rb
288
+ - lib/mongoid/relations/targets.rb
305
289
  - lib/mongoid/relations/touchable.rb
306
- - lib/mongoid/reloading.rb
307
- - lib/mongoid/scoping.rb
308
- - lib/mongoid/serialization.rb
309
- - lib/mongoid/sessions.rb
290
+ - lib/mongoid/relations.rb
291
+ - lib/mongoid/reloadable.rb
292
+ - lib/mongoid/scopable.rb
293
+ - lib/mongoid/selectable.rb
294
+ - lib/mongoid/serializable.rb
310
295
  - lib/mongoid/sessions/factory.rb
311
296
  - lib/mongoid/sessions/mongo_uri.rb
312
- - lib/mongoid/sessions/validators.rb
297
+ - lib/mongoid/sessions/options.rb
298
+ - lib/mongoid/sessions/storage_options.rb
299
+ - lib/mongoid/sessions/thread_options.rb
313
300
  - lib/mongoid/sessions/validators/storage.rb
314
- - lib/mongoid/sharding.rb
301
+ - lib/mongoid/sessions/validators.rb
302
+ - lib/mongoid/sessions.rb
303
+ - lib/mongoid/shardable.rb
315
304
  - lib/mongoid/state.rb
316
- - lib/mongoid/threaded.rb
305
+ - lib/mongoid/support/query_counter.rb
317
306
  - lib/mongoid/threaded/lifecycle.rb
318
- - lib/mongoid/timestamps.rb
319
- - lib/mongoid/timestamps/created.rb
307
+ - lib/mongoid/threaded.rb
320
308
  - lib/mongoid/timestamps/created/short.rb
309
+ - lib/mongoid/timestamps/created.rb
321
310
  - lib/mongoid/timestamps/short.rb
322
311
  - lib/mongoid/timestamps/timeless.rb
323
- - lib/mongoid/timestamps/updated.rb
324
312
  - lib/mongoid/timestamps/updated/short.rb
325
- - lib/mongoid/unit_of_work.rb
326
- - lib/mongoid/validations.rb
327
- - lib/mongoid/validations/associated.rb
328
- - lib/mongoid/validations/format.rb
329
- - lib/mongoid/validations/length.rb
330
- - lib/mongoid/validations/localizable.rb
331
- - lib/mongoid/validations/macros.rb
332
- - lib/mongoid/validations/presence.rb
333
- - lib/mongoid/validations/queryable.rb
334
- - lib/mongoid/validations/uniqueness.rb
313
+ - lib/mongoid/timestamps/updated.rb
314
+ - lib/mongoid/timestamps.rb
315
+ - lib/mongoid/traversable.rb
316
+ - lib/mongoid/validatable/associated.rb
317
+ - lib/mongoid/validatable/format.rb
318
+ - lib/mongoid/validatable/length.rb
319
+ - lib/mongoid/validatable/localizable.rb
320
+ - lib/mongoid/validatable/macros.rb
321
+ - lib/mongoid/validatable/presence.rb
322
+ - lib/mongoid/validatable/queryable.rb
323
+ - lib/mongoid/validatable/uniqueness.rb
324
+ - lib/mongoid/validatable.rb
335
325
  - lib/mongoid/version.rb
336
- - lib/mongoid/versioning.rb
337
- - lib/rack/mongoid.rb
338
- - lib/rack/mongoid/middleware/identity_map.rb
326
+ - lib/mongoid.rb
339
327
  - lib/rails/generators/mongoid/config/config_generator.rb
340
328
  - lib/rails/generators/mongoid/config/templates/mongoid.yml
341
329
  - lib/rails/generators/mongoid/model/model_generator.rb
342
330
  - lib/rails/generators/mongoid/model/templates/model.rb.tt
343
- - lib/rails/generators/mongoid/observer/observer_generator.rb
344
- - lib/rails/generators/mongoid/observer/templates/observer.rb.tt
345
331
  - lib/rails/generators/mongoid_generator.rb
346
332
  - lib/rails/mongoid.rb
347
333
  - lib/support/ruby_version.rb
334
+ - CHANGELOG.md
335
+ - LICENSE
336
+ - README.md
337
+ - Rakefile
348
338
  - spec/app/models/account.rb
349
339
  - spec/app/models/acolyte.rb
350
340
  - spec/app/models/actor.rb
351
- - spec/app/models/actor_observer.rb
352
341
  - spec/app/models/actress.rb
353
342
  - spec/app/models/address.rb
354
343
  - spec/app/models/address_component.rb
@@ -363,6 +352,7 @@ files:
363
352
  - spec/app/models/article.rb
364
353
  - spec/app/models/artist.rb
365
354
  - spec/app/models/artwork.rb
355
+ - spec/app/models/audio.rb
366
356
  - spec/app/models/augmentation.rb
367
357
  - spec/app/models/author.rb
368
358
  - spec/app/models/band.rb
@@ -378,7 +368,6 @@ files:
378
368
  - spec/app/models/building_address.rb
379
369
  - spec/app/models/bus.rb
380
370
  - spec/app/models/business.rb
381
- - spec/app/models/callback_recorder.rb
382
371
  - spec/app/models/callback_test.rb
383
372
  - spec/app/models/canvas.rb
384
373
  - spec/app/models/car.rb
@@ -402,9 +391,10 @@ files:
402
391
  - spec/app/models/doctor.rb
403
392
  - spec/app/models/dog.rb
404
393
  - spec/app/models/dokument.rb
405
- - spec/app/models/draft.rb
394
+ - spec/app/models/dragon.rb
406
395
  - spec/app/models/driver.rb
407
396
  - spec/app/models/drug.rb
397
+ - spec/app/models/dungeon.rb
408
398
  - spec/app/models/email.rb
409
399
  - spec/app/models/employer.rb
410
400
  - spec/app/models/entry.rb
@@ -459,8 +449,6 @@ files:
459
449
  - spec/app/models/page.rb
460
450
  - spec/app/models/page_question.rb
461
451
  - spec/app/models/palette.rb
462
- - spec/app/models/paranoid_phone.rb
463
- - spec/app/models/paranoid_post.rb
464
452
  - spec/app/models/parent.rb
465
453
  - spec/app/models/parent_doc.rb
466
454
  - spec/app/models/passport.rb
@@ -471,7 +459,6 @@ files:
471
459
  - spec/app/models/pet.rb
472
460
  - spec/app/models/pet_owner.rb
473
461
  - spec/app/models/phone.rb
474
- - spec/app/models/phone_observer.rb
475
462
  - spec/app/models/pizza.rb
476
463
  - spec/app/models/player.rb
477
464
  - spec/app/models/post.rb
@@ -504,6 +491,7 @@ files:
504
491
  - spec/app/models/short_quiz.rb
505
492
  - spec/app/models/slave.rb
506
493
  - spec/app/models/song.rb
494
+ - spec/app/models/sound.rb
507
495
  - spec/app/models/square.rb
508
496
  - spec/app/models/strategy.rb
509
497
  - spec/app/models/sub_item.rb
@@ -535,19 +523,18 @@ files:
535
523
  - spec/app/models/word_origin.rb
536
524
  - spec/app/models/writer.rb
537
525
  - spec/config/mongoid.yml
538
- - spec/mongoid/#atomic_spec.rb#
526
+ - spec/helpers.rb
539
527
  - spec/mongoid/atomic/modifiers_spec.rb
540
528
  - spec/mongoid/atomic/paths/embedded/many_spec.rb
541
529
  - spec/mongoid/atomic/paths/embedded/one_spec.rb
542
530
  - spec/mongoid/atomic/paths/root_spec.rb
543
531
  - spec/mongoid/atomic/paths_spec.rb
544
- - spec/mongoid/atomic/positionable_spec.rb
545
532
  - spec/mongoid/atomic_spec.rb
546
- - spec/mongoid/attributes/processing_spec.rb
533
+ - spec/mongoid/attributes/nested_spec.rb
547
534
  - spec/mongoid/attributes/readonly_spec.rb
548
535
  - spec/mongoid/attributes_spec.rb
549
- - spec/mongoid/callbacks_spec.rb
550
- - spec/mongoid/components_spec.rb
536
+ - spec/mongoid/changeable_spec.rb
537
+ - spec/mongoid/composable_spec.rb
551
538
  - spec/mongoid/config/environment_spec.rb
552
539
  - spec/mongoid/config/options_spec.rb
553
540
  - spec/mongoid/config_spec.rb
@@ -559,15 +546,14 @@ files:
559
546
  - spec/mongoid/contextual/map_reduce_spec.rb
560
547
  - spec/mongoid/contextual/memory_spec.rb
561
548
  - spec/mongoid/contextual/mongo_spec.rb
549
+ - spec/mongoid/contextual/text_search_spec.rb
562
550
  - spec/mongoid/copyable_spec.rb
551
+ - spec/mongoid/criteria/findable_spec.rb
552
+ - spec/mongoid/criteria/inspectable_spec.rb
553
+ - spec/mongoid/criteria/marshalable_spec.rb
554
+ - spec/mongoid/criteria/modifiable_spec.rb
555
+ - spec/mongoid/criteria/scopable_spec.rb
563
556
  - spec/mongoid/criteria_spec.rb
564
- - spec/mongoid/criterion/destructive_spec.rb
565
- - spec/mongoid/criterion/inspection_spec.rb
566
- - spec/mongoid/criterion/marshalable_spec.rb
567
- - spec/mongoid/criterion/modifiable_spec.rb
568
- - spec/mongoid/criterion/modification_spec.rb
569
- - spec/mongoid/criterion/scoping_spec.rb
570
- - spec/mongoid/dirty_spec.rb
571
557
  - spec/mongoid/document_spec.rb
572
558
  - spec/mongoid/equality_spec.rb
573
559
  - spec/mongoid/errors/ambiguous_relationship_spec.rb
@@ -608,7 +594,6 @@ files:
608
594
  - spec/mongoid/errors/unsaved_document_spec.rb
609
595
  - spec/mongoid/errors/unsupported_javascript_spec.rb
610
596
  - spec/mongoid/errors/validations_spec.rb
611
- - spec/mongoid/errors/versioning_not_on_root_spec.rb
612
597
  - spec/mongoid/extensions/array_spec.rb
613
598
  - spec/mongoid/extensions/big_decimal_spec.rb
614
599
  - spec/mongoid/extensions/binary_spec.rb
@@ -631,6 +616,7 @@ files:
631
616
  - spec/mongoid/extensions/time_spec.rb
632
617
  - spec/mongoid/extensions/time_with_zone_spec.rb
633
618
  - spec/mongoid/extensions/true_class_spec.rb
619
+ - spec/mongoid/extensions_spec.rb
634
620
  - spec/mongoid/factory_spec.rb
635
621
  - spec/mongoid/fields/foreign_key_spec.rb
636
622
  - spec/mongoid/fields/internal/foreign_keys/array_spec.rb
@@ -638,51 +624,43 @@ files:
638
624
  - spec/mongoid/fields/localized_spec.rb
639
625
  - spec/mongoid/fields/standard_spec.rb
640
626
  - spec/mongoid/fields_spec.rb
641
- - spec/mongoid/finders_spec.rb
642
- - spec/mongoid/hierarchy_spec.rb
643
- - spec/mongoid/identity_map_spec.rb
644
- - spec/mongoid/indexes_spec.rb
645
- - spec/mongoid/inspection_spec.rb
646
- - spec/mongoid/json_spec.rb
627
+ - spec/mongoid/findable_spec.rb
628
+ - spec/mongoid/indexable/specification_spec.rb
629
+ - spec/mongoid/indexable_spec.rb
630
+ - spec/mongoid/inspectable_spec.rb
631
+ - spec/mongoid/interceptable_spec.rb
632
+ - spec/mongoid/log_subscriber_spec.rb
647
633
  - spec/mongoid/loggable_spec.rb
648
- - spec/mongoid/matchers/all_spec.rb
649
- - spec/mongoid/matchers/and_spec.rb
650
- - spec/mongoid/matchers/default_spec.rb
651
- - spec/mongoid/matchers/exists_spec.rb
652
- - spec/mongoid/matchers/gt_spec.rb
653
- - spec/mongoid/matchers/gte_spec.rb
654
- - spec/mongoid/matchers/in_spec.rb
655
- - spec/mongoid/matchers/lt_spec.rb
656
- - spec/mongoid/matchers/lte_spec.rb
657
- - spec/mongoid/matchers/ne_spec.rb
658
- - spec/mongoid/matchers/nin_spec.rb
659
- - spec/mongoid/matchers/or_spec.rb
660
- - spec/mongoid/matchers/size_spec.rb
661
- - spec/mongoid/matchers_spec.rb
662
- - spec/mongoid/multi_parameter_attributes_spec.rb
663
- - spec/mongoid/nested_attributes_spec.rb
664
- - spec/mongoid/observer_spec.rb
665
- - spec/mongoid/paranoia_spec.rb
666
- - spec/mongoid/persistence/atomic/add_to_set_spec.rb
667
- - spec/mongoid/persistence/atomic/bit_spec.rb
668
- - spec/mongoid/persistence/atomic/inc_spec.rb
669
- - spec/mongoid/persistence/atomic/pop_spec.rb
670
- - spec/mongoid/persistence/atomic/pull_all_spec.rb
671
- - spec/mongoid/persistence/atomic/pull_spec.rb
672
- - spec/mongoid/persistence/atomic/push_all_spec.rb
673
- - spec/mongoid/persistence/atomic/push_spec.rb
674
- - spec/mongoid/persistence/atomic/rename_spec.rb
675
- - spec/mongoid/persistence/atomic/sets_spec.rb
676
- - spec/mongoid/persistence/atomic/unset_spec.rb
677
- - spec/mongoid/persistence/atomic_spec.rb
678
- - spec/mongoid/persistence/operations/embedded/insert_spec.rb
679
- - spec/mongoid/persistence/operations/embedded/remove_spec.rb
680
- - spec/mongoid/persistence/operations/insert_spec.rb
681
- - spec/mongoid/persistence/operations/remove_spec.rb
682
- - spec/mongoid/persistence/operations/update_spec.rb
683
- - spec/mongoid/persistence/operations/upsert_spec.rb
684
- - spec/mongoid/persistence/operations_spec.rb
685
- - spec/mongoid/persistence_spec.rb
634
+ - spec/mongoid/matchable/all_spec.rb
635
+ - spec/mongoid/matchable/and_spec.rb
636
+ - spec/mongoid/matchable/default_spec.rb
637
+ - spec/mongoid/matchable/exists_spec.rb
638
+ - spec/mongoid/matchable/gt_spec.rb
639
+ - spec/mongoid/matchable/gte_spec.rb
640
+ - spec/mongoid/matchable/in_spec.rb
641
+ - spec/mongoid/matchable/lt_spec.rb
642
+ - spec/mongoid/matchable/lte_spec.rb
643
+ - spec/mongoid/matchable/ne_spec.rb
644
+ - spec/mongoid/matchable/nin_spec.rb
645
+ - spec/mongoid/matchable/or_spec.rb
646
+ - spec/mongoid/matchable/size_spec.rb
647
+ - spec/mongoid/matchable_spec.rb
648
+ - spec/mongoid/persistable/creatable_spec.rb
649
+ - spec/mongoid/persistable/deletable_spec.rb
650
+ - spec/mongoid/persistable/destroyable_spec.rb
651
+ - spec/mongoid/persistable/incrementable_spec.rb
652
+ - spec/mongoid/persistable/logical_spec.rb
653
+ - spec/mongoid/persistable/poppable_spec.rb
654
+ - spec/mongoid/persistable/pullable_spec.rb
655
+ - spec/mongoid/persistable/pushable_spec.rb
656
+ - spec/mongoid/persistable/renamable_spec.rb
657
+ - spec/mongoid/persistable/savable_spec.rb
658
+ - spec/mongoid/persistable/settable_spec.rb
659
+ - spec/mongoid/persistable/unsettable_spec.rb
660
+ - spec/mongoid/persistable/updatable_spec.rb
661
+ - spec/mongoid/persistable/upsertable_spec.rb
662
+ - spec/mongoid/persistable_spec.rb
663
+ - spec/mongoid/positional_spec.rb
686
664
  - spec/mongoid/railties/document_spec.rb
687
665
  - spec/mongoid/relations/accessors_spec.rb
688
666
  - spec/mongoid/relations/auto_save_spec.rb
@@ -712,6 +690,11 @@ files:
712
690
  - spec/mongoid/relations/conversions_spec.rb
713
691
  - spec/mongoid/relations/counter_cache_spec.rb
714
692
  - spec/mongoid/relations/cyclic_spec.rb
693
+ - spec/mongoid/relations/eager/belongs_to_spec.rb
694
+ - spec/mongoid/relations/eager/has_and_belongs_to_many_spec.rb
695
+ - spec/mongoid/relations/eager/has_many_spec.rb
696
+ - spec/mongoid/relations/eager/has_one_spec.rb
697
+ - spec/mongoid/relations/eager_spec.rb
715
698
  - spec/mongoid/relations/embedded/dirty_spec.rb
716
699
  - spec/mongoid/relations/embedded/in_spec.rb
717
700
  - spec/mongoid/relations/embedded/many_spec.rb
@@ -728,14 +711,17 @@ files:
728
711
  - spec/mongoid/relations/reflections_spec.rb
729
712
  - spec/mongoid/relations/synchronization_spec.rb
730
713
  - spec/mongoid/relations/targets/enumerable_spec.rb
714
+ - spec/mongoid/relations/touchable_spec.rb
731
715
  - spec/mongoid/relations_spec.rb
732
- - spec/mongoid/reloading_spec.rb
733
- - spec/mongoid/scoping_spec.rb
734
- - spec/mongoid/serialization_spec.rb
716
+ - spec/mongoid/reloadable_spec.rb
717
+ - spec/mongoid/scopable_spec.rb
718
+ - spec/mongoid/selectable_spec.rb
719
+ - spec/mongoid/serializable_spec.rb
735
720
  - spec/mongoid/sessions/factory_spec.rb
736
721
  - spec/mongoid/sessions/mongo_uri_spec.rb
722
+ - spec/mongoid/sessions/options_spec.rb
737
723
  - spec/mongoid/sessions_spec.rb
738
- - spec/mongoid/sharding_spec.rb
724
+ - spec/mongoid/shardable_spec.rb
739
725
  - spec/mongoid/state_spec.rb
740
726
  - spec/mongoid/threaded_spec.rb
741
727
  - spec/mongoid/timestamps/created/short_spec.rb
@@ -744,17 +730,15 @@ files:
744
730
  - spec/mongoid/timestamps/updated/short_spec.rb
745
731
  - spec/mongoid/timestamps/updated_spec.rb
746
732
  - spec/mongoid/timestamps_spec.rb
747
- - spec/mongoid/unit_of_work_spec.rb
748
- - spec/mongoid/validations/associated_spec.rb
749
- - spec/mongoid/validations/format_spec.rb
750
- - spec/mongoid/validations/length_spec.rb
751
- - spec/mongoid/validations/numericality_spec.rb
752
- - spec/mongoid/validations/presence_spec.rb
753
- - spec/mongoid/validations/uniqueness_spec.rb
754
- - spec/mongoid/validations_spec.rb
755
- - spec/mongoid/versioning_spec.rb
733
+ - spec/mongoid/traversable_spec.rb
734
+ - spec/mongoid/validatable/associated_spec.rb
735
+ - spec/mongoid/validatable/format_spec.rb
736
+ - spec/mongoid/validatable/length_spec.rb
737
+ - spec/mongoid/validatable/numericality_spec.rb
738
+ - spec/mongoid/validatable/presence_spec.rb
739
+ - spec/mongoid/validatable/uniqueness_spec.rb
740
+ - spec/mongoid/validatable_spec.rb
756
741
  - spec/mongoid_spec.rb
757
- - spec/rack/mongoid/middleware/identity_map_spec.rb
758
742
  - spec/rails/mongoid_spec.rb
759
743
  - spec/spec_helper.rb
760
744
  homepage: http://mongoid.org
@@ -767,17 +751,17 @@ require_paths:
767
751
  - lib
768
752
  required_ruby_version: !ruby/object:Gem::Requirement
769
753
  requirements:
770
- - - ">="
754
+ - - '>='
771
755
  - !ruby/object:Gem::Version
772
756
  version: '1.9'
773
757
  required_rubygems_version: !ruby/object:Gem::Requirement
774
758
  requirements:
775
- - - ">="
759
+ - - '>='
776
760
  - !ruby/object:Gem::Version
777
761
  version: 1.3.6
778
762
  requirements: []
779
763
  rubyforge_project: mongoid
780
- rubygems_version: 2.4.5
764
+ rubygems_version: 2.1.11
781
765
  signing_key:
782
766
  specification_version: 4
783
767
  summary: Elegant Persistance in Ruby for MongoDB.
@@ -785,7 +769,6 @@ test_files:
785
769
  - spec/app/models/account.rb
786
770
  - spec/app/models/acolyte.rb
787
771
  - spec/app/models/actor.rb
788
- - spec/app/models/actor_observer.rb
789
772
  - spec/app/models/actress.rb
790
773
  - spec/app/models/address.rb
791
774
  - spec/app/models/address_component.rb
@@ -800,6 +783,7 @@ test_files:
800
783
  - spec/app/models/article.rb
801
784
  - spec/app/models/artist.rb
802
785
  - spec/app/models/artwork.rb
786
+ - spec/app/models/audio.rb
803
787
  - spec/app/models/augmentation.rb
804
788
  - spec/app/models/author.rb
805
789
  - spec/app/models/band.rb
@@ -815,7 +799,6 @@ test_files:
815
799
  - spec/app/models/building_address.rb
816
800
  - spec/app/models/bus.rb
817
801
  - spec/app/models/business.rb
818
- - spec/app/models/callback_recorder.rb
819
802
  - spec/app/models/callback_test.rb
820
803
  - spec/app/models/canvas.rb
821
804
  - spec/app/models/car.rb
@@ -839,9 +822,10 @@ test_files:
839
822
  - spec/app/models/doctor.rb
840
823
  - spec/app/models/dog.rb
841
824
  - spec/app/models/dokument.rb
842
- - spec/app/models/draft.rb
825
+ - spec/app/models/dragon.rb
843
826
  - spec/app/models/driver.rb
844
827
  - spec/app/models/drug.rb
828
+ - spec/app/models/dungeon.rb
845
829
  - spec/app/models/email.rb
846
830
  - spec/app/models/employer.rb
847
831
  - spec/app/models/entry.rb
@@ -896,8 +880,6 @@ test_files:
896
880
  - spec/app/models/page.rb
897
881
  - spec/app/models/page_question.rb
898
882
  - spec/app/models/palette.rb
899
- - spec/app/models/paranoid_phone.rb
900
- - spec/app/models/paranoid_post.rb
901
883
  - spec/app/models/parent.rb
902
884
  - spec/app/models/parent_doc.rb
903
885
  - spec/app/models/passport.rb
@@ -908,7 +890,6 @@ test_files:
908
890
  - spec/app/models/pet.rb
909
891
  - spec/app/models/pet_owner.rb
910
892
  - spec/app/models/phone.rb
911
- - spec/app/models/phone_observer.rb
912
893
  - spec/app/models/pizza.rb
913
894
  - spec/app/models/player.rb
914
895
  - spec/app/models/post.rb
@@ -941,6 +922,7 @@ test_files:
941
922
  - spec/app/models/short_quiz.rb
942
923
  - spec/app/models/slave.rb
943
924
  - spec/app/models/song.rb
925
+ - spec/app/models/sound.rb
944
926
  - spec/app/models/square.rb
945
927
  - spec/app/models/strategy.rb
946
928
  - spec/app/models/sub_item.rb
@@ -972,19 +954,18 @@ test_files:
972
954
  - spec/app/models/word_origin.rb
973
955
  - spec/app/models/writer.rb
974
956
  - spec/config/mongoid.yml
975
- - spec/mongoid/#atomic_spec.rb#
957
+ - spec/helpers.rb
976
958
  - spec/mongoid/atomic/modifiers_spec.rb
977
959
  - spec/mongoid/atomic/paths/embedded/many_spec.rb
978
960
  - spec/mongoid/atomic/paths/embedded/one_spec.rb
979
961
  - spec/mongoid/atomic/paths/root_spec.rb
980
962
  - spec/mongoid/atomic/paths_spec.rb
981
- - spec/mongoid/atomic/positionable_spec.rb
982
963
  - spec/mongoid/atomic_spec.rb
983
- - spec/mongoid/attributes/processing_spec.rb
964
+ - spec/mongoid/attributes/nested_spec.rb
984
965
  - spec/mongoid/attributes/readonly_spec.rb
985
966
  - spec/mongoid/attributes_spec.rb
986
- - spec/mongoid/callbacks_spec.rb
987
- - spec/mongoid/components_spec.rb
967
+ - spec/mongoid/changeable_spec.rb
968
+ - spec/mongoid/composable_spec.rb
988
969
  - spec/mongoid/config/environment_spec.rb
989
970
  - spec/mongoid/config/options_spec.rb
990
971
  - spec/mongoid/config_spec.rb
@@ -996,15 +977,14 @@ test_files:
996
977
  - spec/mongoid/contextual/map_reduce_spec.rb
997
978
  - spec/mongoid/contextual/memory_spec.rb
998
979
  - spec/mongoid/contextual/mongo_spec.rb
980
+ - spec/mongoid/contextual/text_search_spec.rb
999
981
  - spec/mongoid/copyable_spec.rb
982
+ - spec/mongoid/criteria/findable_spec.rb
983
+ - spec/mongoid/criteria/inspectable_spec.rb
984
+ - spec/mongoid/criteria/marshalable_spec.rb
985
+ - spec/mongoid/criteria/modifiable_spec.rb
986
+ - spec/mongoid/criteria/scopable_spec.rb
1000
987
  - spec/mongoid/criteria_spec.rb
1001
- - spec/mongoid/criterion/destructive_spec.rb
1002
- - spec/mongoid/criterion/inspection_spec.rb
1003
- - spec/mongoid/criterion/marshalable_spec.rb
1004
- - spec/mongoid/criterion/modifiable_spec.rb
1005
- - spec/mongoid/criterion/modification_spec.rb
1006
- - spec/mongoid/criterion/scoping_spec.rb
1007
- - spec/mongoid/dirty_spec.rb
1008
988
  - spec/mongoid/document_spec.rb
1009
989
  - spec/mongoid/equality_spec.rb
1010
990
  - spec/mongoid/errors/ambiguous_relationship_spec.rb
@@ -1045,7 +1025,6 @@ test_files:
1045
1025
  - spec/mongoid/errors/unsaved_document_spec.rb
1046
1026
  - spec/mongoid/errors/unsupported_javascript_spec.rb
1047
1027
  - spec/mongoid/errors/validations_spec.rb
1048
- - spec/mongoid/errors/versioning_not_on_root_spec.rb
1049
1028
  - spec/mongoid/extensions/array_spec.rb
1050
1029
  - spec/mongoid/extensions/big_decimal_spec.rb
1051
1030
  - spec/mongoid/extensions/binary_spec.rb
@@ -1068,6 +1047,7 @@ test_files:
1068
1047
  - spec/mongoid/extensions/time_spec.rb
1069
1048
  - spec/mongoid/extensions/time_with_zone_spec.rb
1070
1049
  - spec/mongoid/extensions/true_class_spec.rb
1050
+ - spec/mongoid/extensions_spec.rb
1071
1051
  - spec/mongoid/factory_spec.rb
1072
1052
  - spec/mongoid/fields/foreign_key_spec.rb
1073
1053
  - spec/mongoid/fields/internal/foreign_keys/array_spec.rb
@@ -1075,51 +1055,43 @@ test_files:
1075
1055
  - spec/mongoid/fields/localized_spec.rb
1076
1056
  - spec/mongoid/fields/standard_spec.rb
1077
1057
  - spec/mongoid/fields_spec.rb
1078
- - spec/mongoid/finders_spec.rb
1079
- - spec/mongoid/hierarchy_spec.rb
1080
- - spec/mongoid/identity_map_spec.rb
1081
- - spec/mongoid/indexes_spec.rb
1082
- - spec/mongoid/inspection_spec.rb
1083
- - spec/mongoid/json_spec.rb
1058
+ - spec/mongoid/findable_spec.rb
1059
+ - spec/mongoid/indexable/specification_spec.rb
1060
+ - spec/mongoid/indexable_spec.rb
1061
+ - spec/mongoid/inspectable_spec.rb
1062
+ - spec/mongoid/interceptable_spec.rb
1063
+ - spec/mongoid/log_subscriber_spec.rb
1084
1064
  - spec/mongoid/loggable_spec.rb
1085
- - spec/mongoid/matchers/all_spec.rb
1086
- - spec/mongoid/matchers/and_spec.rb
1087
- - spec/mongoid/matchers/default_spec.rb
1088
- - spec/mongoid/matchers/exists_spec.rb
1089
- - spec/mongoid/matchers/gt_spec.rb
1090
- - spec/mongoid/matchers/gte_spec.rb
1091
- - spec/mongoid/matchers/in_spec.rb
1092
- - spec/mongoid/matchers/lt_spec.rb
1093
- - spec/mongoid/matchers/lte_spec.rb
1094
- - spec/mongoid/matchers/ne_spec.rb
1095
- - spec/mongoid/matchers/nin_spec.rb
1096
- - spec/mongoid/matchers/or_spec.rb
1097
- - spec/mongoid/matchers/size_spec.rb
1098
- - spec/mongoid/matchers_spec.rb
1099
- - spec/mongoid/multi_parameter_attributes_spec.rb
1100
- - spec/mongoid/nested_attributes_spec.rb
1101
- - spec/mongoid/observer_spec.rb
1102
- - spec/mongoid/paranoia_spec.rb
1103
- - spec/mongoid/persistence/atomic/add_to_set_spec.rb
1104
- - spec/mongoid/persistence/atomic/bit_spec.rb
1105
- - spec/mongoid/persistence/atomic/inc_spec.rb
1106
- - spec/mongoid/persistence/atomic/pop_spec.rb
1107
- - spec/mongoid/persistence/atomic/pull_all_spec.rb
1108
- - spec/mongoid/persistence/atomic/pull_spec.rb
1109
- - spec/mongoid/persistence/atomic/push_all_spec.rb
1110
- - spec/mongoid/persistence/atomic/push_spec.rb
1111
- - spec/mongoid/persistence/atomic/rename_spec.rb
1112
- - spec/mongoid/persistence/atomic/sets_spec.rb
1113
- - spec/mongoid/persistence/atomic/unset_spec.rb
1114
- - spec/mongoid/persistence/atomic_spec.rb
1115
- - spec/mongoid/persistence/operations/embedded/insert_spec.rb
1116
- - spec/mongoid/persistence/operations/embedded/remove_spec.rb
1117
- - spec/mongoid/persistence/operations/insert_spec.rb
1118
- - spec/mongoid/persistence/operations/remove_spec.rb
1119
- - spec/mongoid/persistence/operations/update_spec.rb
1120
- - spec/mongoid/persistence/operations/upsert_spec.rb
1121
- - spec/mongoid/persistence/operations_spec.rb
1122
- - spec/mongoid/persistence_spec.rb
1065
+ - spec/mongoid/matchable/all_spec.rb
1066
+ - spec/mongoid/matchable/and_spec.rb
1067
+ - spec/mongoid/matchable/default_spec.rb
1068
+ - spec/mongoid/matchable/exists_spec.rb
1069
+ - spec/mongoid/matchable/gt_spec.rb
1070
+ - spec/mongoid/matchable/gte_spec.rb
1071
+ - spec/mongoid/matchable/in_spec.rb
1072
+ - spec/mongoid/matchable/lt_spec.rb
1073
+ - spec/mongoid/matchable/lte_spec.rb
1074
+ - spec/mongoid/matchable/ne_spec.rb
1075
+ - spec/mongoid/matchable/nin_spec.rb
1076
+ - spec/mongoid/matchable/or_spec.rb
1077
+ - spec/mongoid/matchable/size_spec.rb
1078
+ - spec/mongoid/matchable_spec.rb
1079
+ - spec/mongoid/persistable/creatable_spec.rb
1080
+ - spec/mongoid/persistable/deletable_spec.rb
1081
+ - spec/mongoid/persistable/destroyable_spec.rb
1082
+ - spec/mongoid/persistable/incrementable_spec.rb
1083
+ - spec/mongoid/persistable/logical_spec.rb
1084
+ - spec/mongoid/persistable/poppable_spec.rb
1085
+ - spec/mongoid/persistable/pullable_spec.rb
1086
+ - spec/mongoid/persistable/pushable_spec.rb
1087
+ - spec/mongoid/persistable/renamable_spec.rb
1088
+ - spec/mongoid/persistable/savable_spec.rb
1089
+ - spec/mongoid/persistable/settable_spec.rb
1090
+ - spec/mongoid/persistable/unsettable_spec.rb
1091
+ - spec/mongoid/persistable/updatable_spec.rb
1092
+ - spec/mongoid/persistable/upsertable_spec.rb
1093
+ - spec/mongoid/persistable_spec.rb
1094
+ - spec/mongoid/positional_spec.rb
1123
1095
  - spec/mongoid/railties/document_spec.rb
1124
1096
  - spec/mongoid/relations/accessors_spec.rb
1125
1097
  - spec/mongoid/relations/auto_save_spec.rb
@@ -1149,6 +1121,11 @@ test_files:
1149
1121
  - spec/mongoid/relations/conversions_spec.rb
1150
1122
  - spec/mongoid/relations/counter_cache_spec.rb
1151
1123
  - spec/mongoid/relations/cyclic_spec.rb
1124
+ - spec/mongoid/relations/eager/belongs_to_spec.rb
1125
+ - spec/mongoid/relations/eager/has_and_belongs_to_many_spec.rb
1126
+ - spec/mongoid/relations/eager/has_many_spec.rb
1127
+ - spec/mongoid/relations/eager/has_one_spec.rb
1128
+ - spec/mongoid/relations/eager_spec.rb
1152
1129
  - spec/mongoid/relations/embedded/dirty_spec.rb
1153
1130
  - spec/mongoid/relations/embedded/in_spec.rb
1154
1131
  - spec/mongoid/relations/embedded/many_spec.rb
@@ -1165,14 +1142,17 @@ test_files:
1165
1142
  - spec/mongoid/relations/reflections_spec.rb
1166
1143
  - spec/mongoid/relations/synchronization_spec.rb
1167
1144
  - spec/mongoid/relations/targets/enumerable_spec.rb
1145
+ - spec/mongoid/relations/touchable_spec.rb
1168
1146
  - spec/mongoid/relations_spec.rb
1169
- - spec/mongoid/reloading_spec.rb
1170
- - spec/mongoid/scoping_spec.rb
1171
- - spec/mongoid/serialization_spec.rb
1147
+ - spec/mongoid/reloadable_spec.rb
1148
+ - spec/mongoid/scopable_spec.rb
1149
+ - spec/mongoid/selectable_spec.rb
1150
+ - spec/mongoid/serializable_spec.rb
1172
1151
  - spec/mongoid/sessions/factory_spec.rb
1173
1152
  - spec/mongoid/sessions/mongo_uri_spec.rb
1153
+ - spec/mongoid/sessions/options_spec.rb
1174
1154
  - spec/mongoid/sessions_spec.rb
1175
- - spec/mongoid/sharding_spec.rb
1155
+ - spec/mongoid/shardable_spec.rb
1176
1156
  - spec/mongoid/state_spec.rb
1177
1157
  - spec/mongoid/threaded_spec.rb
1178
1158
  - spec/mongoid/timestamps/created/short_spec.rb
@@ -1181,16 +1161,14 @@ test_files:
1181
1161
  - spec/mongoid/timestamps/updated/short_spec.rb
1182
1162
  - spec/mongoid/timestamps/updated_spec.rb
1183
1163
  - spec/mongoid/timestamps_spec.rb
1184
- - spec/mongoid/unit_of_work_spec.rb
1185
- - spec/mongoid/validations/associated_spec.rb
1186
- - spec/mongoid/validations/format_spec.rb
1187
- - spec/mongoid/validations/length_spec.rb
1188
- - spec/mongoid/validations/numericality_spec.rb
1189
- - spec/mongoid/validations/presence_spec.rb
1190
- - spec/mongoid/validations/uniqueness_spec.rb
1191
- - spec/mongoid/validations_spec.rb
1192
- - spec/mongoid/versioning_spec.rb
1164
+ - spec/mongoid/traversable_spec.rb
1165
+ - spec/mongoid/validatable/associated_spec.rb
1166
+ - spec/mongoid/validatable/format_spec.rb
1167
+ - spec/mongoid/validatable/length_spec.rb
1168
+ - spec/mongoid/validatable/numericality_spec.rb
1169
+ - spec/mongoid/validatable/presence_spec.rb
1170
+ - spec/mongoid/validatable/uniqueness_spec.rb
1171
+ - spec/mongoid/validatable_spec.rb
1193
1172
  - spec/mongoid_spec.rb
1194
- - spec/rack/mongoid/middleware/identity_map_spec.rb
1195
1173
  - spec/rails/mongoid_spec.rb
1196
1174
  - spec/spec_helper.rb