mongoid 4.0.2 → 5.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +66 -1
  3. data/README.md +14 -13
  4. data/lib/config/locales/en.yml +28 -28
  5. data/lib/mongoid.rb +28 -21
  6. data/lib/mongoid/atomic.rb +2 -4
  7. data/lib/mongoid/attributes.rb +7 -7
  8. data/lib/mongoid/attributes/processing.rb +4 -1
  9. data/lib/mongoid/attributes/readonly.rb +2 -2
  10. data/lib/mongoid/changeable.rb +4 -6
  11. data/lib/mongoid/clients.rb +142 -0
  12. data/lib/mongoid/clients/factory.rb +78 -0
  13. data/lib/mongoid/{sessions → clients}/options.rb +30 -19
  14. data/lib/mongoid/{sessions → clients}/storage_options.rb +27 -13
  15. data/lib/mongoid/{sessions → clients}/thread_options.rb +6 -3
  16. data/lib/mongoid/clients/validators.rb +2 -0
  17. data/lib/mongoid/{sessions → clients}/validators/storage.rb +5 -2
  18. data/lib/mongoid/composable.rb +3 -3
  19. data/lib/mongoid/config.rb +39 -41
  20. data/lib/mongoid/config/environment.rb +1 -1
  21. data/lib/mongoid/config/validators.rb +1 -1
  22. data/lib/mongoid/config/validators/{session.rb → client.rb} +31 -28
  23. data/lib/mongoid/contextual/aggregable/mongo.rb +1 -1
  24. data/lib/mongoid/contextual/atomic.rb +11 -11
  25. data/lib/mongoid/contextual/command.rb +9 -6
  26. data/lib/mongoid/contextual/geo_near.rb +17 -1
  27. data/lib/mongoid/contextual/map_reduce.rb +12 -11
  28. data/lib/mongoid/contextual/memory.rb +2 -5
  29. data/lib/mongoid/contextual/mongo.rb +92 -82
  30. data/lib/mongoid/contextual/none.rb +13 -0
  31. data/lib/mongoid/copyable.rb +6 -1
  32. data/lib/mongoid/criteria.rb +36 -3
  33. data/lib/mongoid/document.rb +3 -4
  34. data/lib/mongoid/errors.rb +6 -6
  35. data/lib/mongoid/errors/{mixed_session_configuration.rb → mixed_client_configuration.rb} +5 -5
  36. data/lib/mongoid/errors/no_client_config.rb +22 -0
  37. data/lib/mongoid/errors/{no_session_database.rb → no_client_database.rb} +4 -4
  38. data/lib/mongoid/errors/{no_session_hosts.rb → no_client_hosts.rb} +4 -4
  39. data/lib/mongoid/errors/{no_sessions_config.rb → no_clients_config.rb} +4 -4
  40. data/lib/mongoid/errors/no_default_client.rb +23 -0
  41. data/lib/mongoid/extensions/hash.rb +5 -1
  42. data/lib/mongoid/extensions/object.rb +3 -2
  43. data/lib/mongoid/extensions/set.rb +5 -5
  44. data/lib/mongoid/factory.rb +4 -2
  45. data/lib/mongoid/fields.rb +7 -2
  46. data/lib/mongoid/findable.rb +4 -1
  47. data/lib/mongoid/indexable.rb +15 -9
  48. data/lib/mongoid/persistable.rb +1 -2
  49. data/lib/mongoid/persistable/creatable.rb +2 -2
  50. data/lib/mongoid/persistable/deletable.rb +3 -3
  51. data/lib/mongoid/persistable/incrementable.rb +1 -1
  52. data/lib/mongoid/persistable/logical.rb +1 -1
  53. data/lib/mongoid/persistable/poppable.rb +1 -1
  54. data/lib/mongoid/persistable/pullable.rb +2 -2
  55. data/lib/mongoid/persistable/pushable.rb +2 -2
  56. data/lib/mongoid/persistable/renamable.rb +1 -1
  57. data/lib/mongoid/persistable/settable.rb +1 -1
  58. data/lib/mongoid/persistable/unsettable.rb +1 -1
  59. data/lib/mongoid/persistable/updatable.rb +2 -2
  60. data/lib/mongoid/persistable/upsertable.rb +1 -1
  61. data/lib/mongoid/query_cache.rb +98 -104
  62. data/lib/mongoid/railtie.rb +1 -21
  63. data/lib/mongoid/railties/database.rake +1 -1
  64. data/lib/mongoid/relations/builders.rb +3 -1
  65. data/lib/mongoid/relations/counter_cache.rb +1 -1
  66. data/lib/mongoid/relations/embedded/batchable.rb +3 -10
  67. data/lib/mongoid/relations/embedded/many.rb +4 -2
  68. data/lib/mongoid/relations/many.rb +1 -0
  69. data/lib/mongoid/relations/proxy.rb +6 -6
  70. data/lib/mongoid/relations/referenced/many.rb +2 -1
  71. data/lib/mongoid/relations/targets/enumerable.rb +11 -11
  72. data/lib/mongoid/relations/touchable.rb +1 -1
  73. data/lib/mongoid/reloadable.rb +2 -2
  74. data/lib/mongoid/scopable.rb +6 -17
  75. data/lib/mongoid/selectable.rb +1 -36
  76. data/lib/mongoid/serializable.rb +2 -2
  77. data/lib/mongoid/stateful.rb +0 -1
  78. data/lib/mongoid/tasks/database.rake +2 -2
  79. data/lib/mongoid/tasks/database.rb +23 -16
  80. data/lib/mongoid/threaded.rb +54 -33
  81. data/lib/mongoid/threaded/lifecycle.rb +21 -16
  82. data/lib/mongoid/traversable.rb +16 -1
  83. data/lib/mongoid/validatable.rb +1 -1
  84. data/lib/mongoid/validatable/queryable.rb +1 -1
  85. data/lib/mongoid/validatable/uniqueness.rb +3 -20
  86. data/lib/mongoid/version.rb +1 -1
  87. data/lib/rails/generators/mongoid/config/templates/mongoid.yml +91 -57
  88. data/lib/rails/mongoid.rb +2 -2
  89. data/spec/app/models/audio.rb +1 -1
  90. data/spec/app/models/band.rb +1 -0
  91. data/spec/app/models/company.rb +5 -0
  92. data/spec/app/models/label.rb +7 -0
  93. data/spec/app/models/pub.rb +6 -0
  94. data/spec/app/models/staff.rb +7 -0
  95. data/spec/app/models/store_as_dup_test1.rb +5 -0
  96. data/spec/app/models/store_as_dup_test2.rb +5 -0
  97. data/spec/config/mongoid.yml +7 -25
  98. data/spec/mongoid/atomic/paths_spec.rb +3 -11
  99. data/spec/mongoid/attributes/nested_spec.rb +16 -16
  100. data/spec/mongoid/attributes/readonly_spec.rb +80 -18
  101. data/spec/mongoid/attributes_spec.rb +3 -3
  102. data/spec/mongoid/changeable_spec.rb +70 -0
  103. data/spec/mongoid/clients/factory_spec.rb +284 -0
  104. data/spec/mongoid/{sessions → clients}/options_spec.rb +4 -6
  105. data/spec/mongoid/clients_spec.rb +739 -0
  106. data/spec/mongoid/config/environment_spec.rb +14 -11
  107. data/spec/mongoid/config_spec.rb +33 -48
  108. data/spec/mongoid/contextual/atomic_spec.rb +1 -17
  109. data/spec/mongoid/contextual/geo_near_spec.rb +35 -0
  110. data/spec/mongoid/contextual/mongo_spec.rb +26 -83
  111. data/spec/mongoid/contextual/none_spec.rb +15 -0
  112. data/spec/mongoid/copyable_spec.rb +35 -1
  113. data/spec/mongoid/criteria/findable_spec.rb +197 -0
  114. data/spec/mongoid/criteria/modifiable_spec.rb +7 -29
  115. data/spec/mongoid/criteria_spec.rb +74 -91
  116. data/spec/mongoid/document_spec.rb +1 -1
  117. data/spec/mongoid/errors/{mixed_session_configuration_spec.rb → mixed_client_configuration_spec.rb} +1 -1
  118. data/spec/mongoid/errors/{no_session_config_spec.rb → no_client_config_spec.rb} +4 -4
  119. data/spec/mongoid/errors/{no_session_database_spec.rb → no_client_database_spec.rb} +4 -4
  120. data/spec/mongoid/errors/{no_session_hosts_spec.rb → no_client_hosts_spec.rb} +3 -3
  121. data/spec/mongoid/errors/{no_sessions_config_spec.rb → no_clients_config_spec.rb} +2 -2
  122. data/spec/mongoid/fields/localized_spec.rb +1 -0
  123. data/spec/mongoid/fields_spec.rb +1 -0
  124. data/spec/mongoid/findable_spec.rb +2 -23
  125. data/spec/mongoid/indexable_spec.rb +12 -8
  126. data/spec/mongoid/interceptable_spec.rb +15 -0
  127. data/spec/mongoid/persistable/settable_spec.rb +16 -0
  128. data/spec/mongoid/persistable/updatable_spec.rb +3 -2
  129. data/spec/mongoid/persistable_spec.rb +4 -4
  130. data/spec/mongoid/query_cache_spec.rb +13 -8
  131. data/spec/mongoid/relations/auto_save_spec.rb +1 -1
  132. data/spec/mongoid/relations/counter_cache_spec.rb +34 -0
  133. data/spec/mongoid/relations/eager/belongs_to_spec.rb +9 -0
  134. data/spec/mongoid/relations/eager/has_and_belongs_to_many_spec.rb +3 -3
  135. data/spec/mongoid/relations/embedded/many_spec.rb +123 -1
  136. data/spec/mongoid/relations/embedded/one_spec.rb +3 -3
  137. data/spec/mongoid/relations/proxy_spec.rb +28 -0
  138. data/spec/mongoid/relations/referenced/in_spec.rb +1 -1
  139. data/spec/mongoid/relations/referenced/many_spec.rb +47 -23
  140. data/spec/mongoid/relations/referenced/many_to_many_spec.rb +1 -1
  141. data/spec/mongoid/relations/referenced/one_spec.rb +1 -1
  142. data/spec/mongoid/relations/targets/enumerable_spec.rb +9 -2
  143. data/spec/mongoid/reloadable_spec.rb +6 -6
  144. data/spec/mongoid/scopable_spec.rb +41 -28
  145. data/spec/mongoid/selectable_spec.rb +6 -16
  146. data/spec/mongoid/tasks/database_rake_spec.rb +13 -13
  147. data/spec/mongoid/tasks/database_spec.rb +2 -2
  148. data/spec/mongoid/threaded_spec.rb +0 -7
  149. data/spec/mongoid/traversable_spec.rb +2 -2
  150. data/spec/mongoid/validatable/uniqueness_spec.rb +30 -1
  151. data/spec/mongoid_spec.rb +13 -15
  152. data/spec/rails/mongoid_spec.rb +13 -4
  153. data/spec/spec_helper.rb +44 -27
  154. data/spec/support/authorization.rb +12 -0
  155. data/spec/support/expectations.rb +14 -0
  156. metadata +52 -59
  157. data/lib/mongoid/contextual/find_and_modify.rb +0 -69
  158. data/lib/mongoid/contextual/text_search.rb +0 -178
  159. data/lib/mongoid/criteria/#findable.rb# +0 -141
  160. data/lib/mongoid/errors/no_default_session.rb +0 -23
  161. data/lib/mongoid/errors/no_session_config.rb +0 -22
  162. data/lib/mongoid/log_subscriber.rb +0 -55
  163. data/lib/mongoid/positional.rb +0 -71
  164. data/lib/mongoid/sessions.rb +0 -125
  165. data/lib/mongoid/sessions/factory.rb +0 -131
  166. data/lib/mongoid/sessions/mongo_uri.rb +0 -93
  167. data/lib/mongoid/sessions/validators.rb +0 -2
  168. data/lib/mongoid/support/query_counter.rb +0 -23
  169. data/spec/helpers.rb +0 -18
  170. data/spec/mongoid/#atomic_spec.rb# +0 -365
  171. data/spec/mongoid/contextual/find_and_modify_spec.rb +0 -220
  172. data/spec/mongoid/contextual/text_search_spec.rb +0 -209
  173. data/spec/mongoid/log_subscriber_spec.rb +0 -75
  174. data/spec/mongoid/positional_spec.rb +0 -222
  175. data/spec/mongoid/sessions/factory_spec.rb +0 -333
  176. data/spec/mongoid/sessions/mongo_uri_spec.rb +0 -103
  177. data/spec/mongoid/sessions_spec.rb +0 -1252
@@ -14,18 +14,17 @@ end
14
14
  require "action_controller"
15
15
  require "mongoid"
16
16
  require "rspec"
17
- require "helpers"
18
17
 
19
18
  # These environment variables can be set if wanting to test against a database
20
19
  # that is not on the local machine.
21
- ENV["MONGOID_SPEC_HOST"] ||= "localhost"
20
+ ENV["MONGOID_SPEC_HOST"] ||= "127.0.0.1"
22
21
  ENV["MONGOID_SPEC_PORT"] ||= "27017"
23
22
 
24
23
  # These are used when creating any connection in the test suite.
25
24
  HOST = ENV["MONGOID_SPEC_HOST"]
26
25
  PORT = ENV["MONGOID_SPEC_PORT"].to_i
27
26
 
28
- # Moped.logger.level = Logger::DEBUG
27
+ Mongo::Logger.logger.level = Logger::INFO
29
28
  # Mongoid.logger.level = Logger::DEBUG
30
29
 
31
30
  # When testing locally we use the database named mongoid_test. However when
@@ -40,31 +39,43 @@ def database_id_alt
40
39
  "mongoid_test_alt"
41
40
  end
42
41
 
42
+ require 'support/authorization'
43
+ require 'support/expectations'
44
+
45
+ # Give MongoDB time to start up on the travis ci environment.
46
+ if (ENV['CI'] == 'travis')
47
+ starting = true
48
+ client = Mongo::Client.new(['127.0.0.1:27017'])
49
+ while starting
50
+ begin
51
+ client.command(Mongo::Server::Monitor::STATUS)
52
+ break
53
+ rescue Mongo::Error::OperationFailure => e
54
+ sleep(2)
55
+ client.cluster.scan!
56
+ end
57
+ end
58
+ end
59
+
43
60
  CONFIG = {
44
- sessions: {
61
+ clients: {
45
62
  default: {
46
63
  database: database_id,
47
- hosts: [ "#{HOST}:#{PORT}" ]
64
+ hosts: [ "#{HOST}:#{PORT}" ],
65
+ options: {
66
+ server_selection_timeout: 0.5,
67
+ max_pool_size: 1,
68
+ heartbeat_frequency: 180,
69
+ user: MONGOID_ROOT_USER.name,
70
+ password: MONGOID_ROOT_USER.password,
71
+ auth_source: Mongo::Database::ADMIN
72
+ }
48
73
  }
49
74
  }
50
75
  }
51
76
 
52
- # Can we connect to MongoHQ from this box?
53
- def mongohq_connectable?
54
- ENV["MONGOHQ_REPL_PASS"].present?
55
- end
56
-
57
- def purge_database_alt!
58
- session = Mongoid::Sessions.default
59
- session.use(database_id_alt)
60
- session.collections.each do |collection|
61
- collection.drop
62
- end
63
- end
64
-
65
- def mongodb_version
66
- session = Mongoid::Sessions.default
67
- session.command(buildinfo: 1)["version"]
77
+ def non_legacy_server?
78
+ Mongoid::Clients.default.cluster.servers.first.features.write_command_enabled?
68
79
  end
69
80
 
70
81
  # Set the database that the spec suite connects to.
@@ -96,16 +107,22 @@ end
96
107
  I18n.config.enforce_available_locales = false
97
108
 
98
109
  RSpec.configure do |config|
99
- config.include Mongoid::SpecHelpers
100
110
  config.raise_errors_for_deprecations!
111
+ config.include(Mongoid::Expectations)
112
+
113
+ config.before(:suite) do
114
+ client = Mongo::Client.new(["#{HOST}:#{PORT}"])
115
+ begin
116
+ # Create the root user administrator as the first user to be added to the
117
+ # database. This user will need to be authenticated in order to add any
118
+ # more users to any other databases.
119
+ client.database.users.create(MONGOID_ROOT_USER)
120
+ rescue Exception => e
121
+ end
122
+ end
101
123
 
102
124
  # Drop all collections and clear the identity map before each spec.
103
125
  config.before(:each) do
104
126
  Mongoid.purge!
105
127
  end
106
-
107
- # Filter out MongoHQ specs if we can't connect to it.
108
- config.filter_run_excluding(config: ->(value){
109
- return true if value == :mongohq && !mongohq_connectable?
110
- })
111
128
  end
@@ -0,0 +1,12 @@
1
+ # Set up a root user so we can set up authentication on a database level.
2
+ MONGOID_ROOT_USER = Mongo::Auth::User.new(
3
+ database: Mongo::Database::ADMIN,
4
+ user: 'mongoid-user',
5
+ password: 'password',
6
+ roles: [
7
+ Mongo::Auth::Roles::USER_ADMIN_ANY_DATABASE,
8
+ Mongo::Auth::Roles::DATABASE_ADMIN_ANY_DATABASE,
9
+ Mongo::Auth::Roles::READ_WRITE_ANY_DATABASE,
10
+ Mongo::Auth::Roles::HOST_MANAGER
11
+ ]
12
+ )
@@ -0,0 +1,14 @@
1
+ module Mongoid
2
+ module Expectations
3
+
4
+ def expect_query(number)
5
+ # There are both start and complete events for each query.
6
+ expect(Mongo::Logger.logger).to receive(:debug?).exactly(number * 2).times.and_call_original
7
+ yield
8
+ end
9
+
10
+ def expect_no_queries(&block)
11
+ expect_query(0, &block)
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 5.0.0.beta
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-02-19 00:00:00.000000000 Z
11
+ date: 2015-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.3.37
41
41
  - !ruby/object:Gem::Dependency
42
- name: moped
42
+ name: mongo
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0
47
+ version: 2.1.0.beta
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: 2.0.0
54
+ version: 2.1.0.beta
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: origin
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -93,29 +93,33 @@ files:
93
93
  - lib/mongoid/attributes/processing.rb
94
94
  - lib/mongoid/attributes/readonly.rb
95
95
  - lib/mongoid/changeable.rb
96
+ - lib/mongoid/clients.rb
97
+ - lib/mongoid/clients/factory.rb
98
+ - lib/mongoid/clients/options.rb
99
+ - lib/mongoid/clients/storage_options.rb
100
+ - lib/mongoid/clients/thread_options.rb
101
+ - lib/mongoid/clients/validators.rb
102
+ - lib/mongoid/clients/validators/storage.rb
96
103
  - lib/mongoid/composable.rb
97
104
  - lib/mongoid/config.rb
98
105
  - lib/mongoid/config/environment.rb
99
106
  - lib/mongoid/config/options.rb
100
107
  - lib/mongoid/config/validators.rb
108
+ - lib/mongoid/config/validators/client.rb
101
109
  - lib/mongoid/config/validators/option.rb
102
- - lib/mongoid/config/validators/session.rb
103
110
  - lib/mongoid/contextual.rb
104
111
  - lib/mongoid/contextual/aggregable/memory.rb
105
112
  - lib/mongoid/contextual/aggregable/mongo.rb
106
113
  - lib/mongoid/contextual/atomic.rb
107
114
  - lib/mongoid/contextual/command.rb
108
- - lib/mongoid/contextual/find_and_modify.rb
109
115
  - lib/mongoid/contextual/geo_near.rb
110
116
  - lib/mongoid/contextual/map_reduce.rb
111
117
  - lib/mongoid/contextual/memory.rb
112
118
  - lib/mongoid/contextual/mongo.rb
113
119
  - lib/mongoid/contextual/none.rb
114
120
  - lib/mongoid/contextual/queryable.rb
115
- - lib/mongoid/contextual/text_search.rb
116
121
  - lib/mongoid/copyable.rb
117
122
  - lib/mongoid/criteria.rb
118
- - lib/mongoid/criteria/#findable.rb#
119
123
  - lib/mongoid/criteria/findable.rb
120
124
  - lib/mongoid/criteria/inspectable.rb
121
125
  - lib/mongoid/criteria/marshalable.rb
@@ -147,19 +151,19 @@ files:
147
151
  - lib/mongoid/errors/invalid_time.rb
148
152
  - lib/mongoid/errors/invalid_value.rb
149
153
  - lib/mongoid/errors/inverse_not_found.rb
154
+ - lib/mongoid/errors/mixed_client_configuration.rb
150
155
  - lib/mongoid/errors/mixed_relations.rb
151
- - lib/mongoid/errors/mixed_session_configuration.rb
152
156
  - lib/mongoid/errors/mongoid_error.rb
153
157
  - lib/mongoid/errors/nested_attributes_metadata_not_found.rb
154
- - lib/mongoid/errors/no_default_session.rb
158
+ - lib/mongoid/errors/no_client_config.rb
159
+ - lib/mongoid/errors/no_client_database.rb
160
+ - lib/mongoid/errors/no_client_hosts.rb
161
+ - lib/mongoid/errors/no_clients_config.rb
162
+ - lib/mongoid/errors/no_default_client.rb
155
163
  - lib/mongoid/errors/no_environment.rb
156
164
  - lib/mongoid/errors/no_map_reduce_output.rb
157
165
  - lib/mongoid/errors/no_metadata.rb
158
166
  - lib/mongoid/errors/no_parent.rb
159
- - lib/mongoid/errors/no_session_config.rb
160
- - lib/mongoid/errors/no_session_database.rb
161
- - lib/mongoid/errors/no_session_hosts.rb
162
- - lib/mongoid/errors/no_sessions_config.rb
163
167
  - lib/mongoid/errors/readonly_attribute.rb
164
168
  - lib/mongoid/errors/readonly_document.rb
165
169
  - lib/mongoid/errors/scope_overwrite.rb
@@ -204,7 +208,6 @@ files:
204
208
  - lib/mongoid/indexable/validators/options.rb
205
209
  - lib/mongoid/inspectable.rb
206
210
  - lib/mongoid/interceptable.rb
207
- - lib/mongoid/log_subscriber.rb
208
211
  - lib/mongoid/loggable.rb
209
212
  - lib/mongoid/matchable.rb
210
213
  - lib/mongoid/matchable/all.rb
@@ -235,7 +238,6 @@ files:
235
238
  - lib/mongoid/persistable/unsettable.rb
236
239
  - lib/mongoid/persistable/updatable.rb
237
240
  - lib/mongoid/persistable/upsertable.rb
238
- - lib/mongoid/positional.rb
239
241
  - lib/mongoid/query_cache.rb
240
242
  - lib/mongoid/railtie.rb
241
243
  - lib/mongoid/railties/database.rake
@@ -304,17 +306,8 @@ files:
304
306
  - lib/mongoid/scopable.rb
305
307
  - lib/mongoid/selectable.rb
306
308
  - lib/mongoid/serializable.rb
307
- - lib/mongoid/sessions.rb
308
- - lib/mongoid/sessions/factory.rb
309
- - lib/mongoid/sessions/mongo_uri.rb
310
- - lib/mongoid/sessions/options.rb
311
- - lib/mongoid/sessions/storage_options.rb
312
- - lib/mongoid/sessions/thread_options.rb
313
- - lib/mongoid/sessions/validators.rb
314
- - lib/mongoid/sessions/validators/storage.rb
315
309
  - lib/mongoid/shardable.rb
316
310
  - lib/mongoid/stateful.rb
317
- - lib/mongoid/support/query_counter.rb
318
311
  - lib/mongoid/tasks/database.rake
319
312
  - lib/mongoid/tasks/database.rb
320
313
  - lib/mongoid/threaded.rb
@@ -390,6 +383,7 @@ files:
390
383
  - spec/app/models/circus.rb
391
384
  - spec/app/models/code.rb
392
385
  - spec/app/models/comment.rb
386
+ - spec/app/models/company.rb
393
387
  - spec/app/models/contextable_item.rb
394
388
  - spec/app/models/contractor.rb
395
389
  - spec/app/models/cookie.rb
@@ -484,6 +478,7 @@ files:
484
478
  - spec/app/models/product.rb
485
479
  - spec/app/models/profile.rb
486
480
  - spec/app/models/pronunciation.rb
481
+ - spec/app/models/pub.rb
487
482
  - spec/app/models/purchase.rb
488
483
  - spec/app/models/question.rb
489
484
  - spec/app/models/quiz.rb
@@ -509,6 +504,9 @@ files:
509
504
  - spec/app/models/song.rb
510
505
  - spec/app/models/sound.rb
511
506
  - spec/app/models/square.rb
507
+ - spec/app/models/staff.rb
508
+ - spec/app/models/store_as_dup_test1.rb
509
+ - spec/app/models/store_as_dup_test2.rb
512
510
  - spec/app/models/strategy.rb
513
511
  - spec/app/models/sub_item.rb
514
512
  - spec/app/models/subscription.rb
@@ -539,8 +537,6 @@ files:
539
537
  - spec/app/models/word_origin.rb
540
538
  - spec/app/models/writer.rb
541
539
  - spec/config/mongoid.yml
542
- - spec/helpers.rb
543
- - spec/mongoid/#atomic_spec.rb#
544
540
  - spec/mongoid/atomic/modifiers_spec.rb
545
541
  - spec/mongoid/atomic/paths/embedded/many_spec.rb
546
542
  - spec/mongoid/atomic/paths/embedded/one_spec.rb
@@ -551,6 +547,9 @@ files:
551
547
  - spec/mongoid/attributes/readonly_spec.rb
552
548
  - spec/mongoid/attributes_spec.rb
553
549
  - spec/mongoid/changeable_spec.rb
550
+ - spec/mongoid/clients/factory_spec.rb
551
+ - spec/mongoid/clients/options_spec.rb
552
+ - spec/mongoid/clients_spec.rb
554
553
  - spec/mongoid/composable_spec.rb
555
554
  - spec/mongoid/config/environment_spec.rb
556
555
  - spec/mongoid/config/options_spec.rb
@@ -558,13 +557,11 @@ files:
558
557
  - spec/mongoid/contextual/aggregable/memory_spec.rb
559
558
  - spec/mongoid/contextual/aggregable/mongo_spec.rb
560
559
  - spec/mongoid/contextual/atomic_spec.rb
561
- - spec/mongoid/contextual/find_and_modify_spec.rb
562
560
  - spec/mongoid/contextual/geo_near_spec.rb
563
561
  - spec/mongoid/contextual/map_reduce_spec.rb
564
562
  - spec/mongoid/contextual/memory_spec.rb
565
563
  - spec/mongoid/contextual/mongo_spec.rb
566
564
  - spec/mongoid/contextual/none_spec.rb
567
- - spec/mongoid/contextual/text_search_spec.rb
568
565
  - spec/mongoid/copyable_spec.rb
569
566
  - spec/mongoid/criteria/findable_spec.rb
570
567
  - spec/mongoid/criteria/inspectable_spec.rb
@@ -594,18 +591,18 @@ files:
594
591
  - spec/mongoid/errors/invalid_storage_options_spec.rb
595
592
  - spec/mongoid/errors/invalid_time_spec.rb
596
593
  - spec/mongoid/errors/inverse_not_found_spec.rb
594
+ - spec/mongoid/errors/mixed_client_configuration_spec.rb
597
595
  - spec/mongoid/errors/mixed_relations_spec.rb
598
- - spec/mongoid/errors/mixed_session_configuration_spec.rb
599
596
  - spec/mongoid/errors/mongoid_error_spec.rb
600
597
  - spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb
598
+ - spec/mongoid/errors/no_client_config_spec.rb
599
+ - spec/mongoid/errors/no_client_database_spec.rb
600
+ - spec/mongoid/errors/no_client_hosts_spec.rb
601
+ - spec/mongoid/errors/no_clients_config_spec.rb
601
602
  - spec/mongoid/errors/no_environment_spec.rb
602
603
  - spec/mongoid/errors/no_map_reduce_output_spec.rb
603
604
  - spec/mongoid/errors/no_metadata_spec.rb
604
605
  - spec/mongoid/errors/no_parent_spec.rb
605
- - spec/mongoid/errors/no_session_config_spec.rb
606
- - spec/mongoid/errors/no_session_database_spec.rb
607
- - spec/mongoid/errors/no_session_hosts_spec.rb
608
- - spec/mongoid/errors/no_sessions_config_spec.rb
609
606
  - spec/mongoid/errors/readonly_attribute_spec.rb
610
607
  - spec/mongoid/errors/readonly_document_spec.rb
611
608
  - spec/mongoid/errors/scope_overwrite_spec.rb
@@ -649,7 +646,6 @@ files:
649
646
  - spec/mongoid/indexable_spec.rb
650
647
  - spec/mongoid/inspectable_spec.rb
651
648
  - spec/mongoid/interceptable_spec.rb
652
- - spec/mongoid/log_subscriber_spec.rb
653
649
  - spec/mongoid/loggable_spec.rb
654
650
  - spec/mongoid/matchable/all_spec.rb
655
651
  - spec/mongoid/matchable/and_spec.rb
@@ -680,7 +676,6 @@ files:
680
676
  - spec/mongoid/persistable/updatable_spec.rb
681
677
  - spec/mongoid/persistable/upsertable_spec.rb
682
678
  - spec/mongoid/persistable_spec.rb
683
- - spec/mongoid/positional_spec.rb
684
679
  - spec/mongoid/query_cache_spec.rb
685
680
  - spec/mongoid/railties/document_spec.rb
686
681
  - spec/mongoid/relations/accessors_spec.rb
@@ -738,10 +733,6 @@ files:
738
733
  - spec/mongoid/scopable_spec.rb
739
734
  - spec/mongoid/selectable_spec.rb
740
735
  - spec/mongoid/serializable_spec.rb
741
- - spec/mongoid/sessions/factory_spec.rb
742
- - spec/mongoid/sessions/mongo_uri_spec.rb
743
- - spec/mongoid/sessions/options_spec.rb
744
- - spec/mongoid/sessions_spec.rb
745
736
  - spec/mongoid/shardable_spec.rb
746
737
  - spec/mongoid/stateful_spec.rb
747
738
  - spec/mongoid/tasks/database_rake_spec.rb
@@ -764,6 +755,8 @@ files:
764
755
  - spec/mongoid_spec.rb
765
756
  - spec/rails/mongoid_spec.rb
766
757
  - spec/spec_helper.rb
758
+ - spec/support/authorization.rb
759
+ - spec/support/expectations.rb
767
760
  homepage: http://mongoid.org
768
761
  licenses:
769
762
  - MIT
@@ -784,7 +777,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
784
777
  version: 1.3.6
785
778
  requirements: []
786
779
  rubyforge_project: mongoid
787
- rubygems_version: 2.4.5
780
+ rubygems_version: 2.4.6
788
781
  signing_key:
789
782
  specification_version: 4
790
783
  summary: Elegant Persistance in Ruby for MongoDB.
@@ -835,6 +828,7 @@ test_files:
835
828
  - spec/app/models/circus.rb
836
829
  - spec/app/models/code.rb
837
830
  - spec/app/models/comment.rb
831
+ - spec/app/models/company.rb
838
832
  - spec/app/models/contextable_item.rb
839
833
  - spec/app/models/contractor.rb
840
834
  - spec/app/models/cookie.rb
@@ -929,6 +923,7 @@ test_files:
929
923
  - spec/app/models/product.rb
930
924
  - spec/app/models/profile.rb
931
925
  - spec/app/models/pronunciation.rb
926
+ - spec/app/models/pub.rb
932
927
  - spec/app/models/purchase.rb
933
928
  - spec/app/models/question.rb
934
929
  - spec/app/models/quiz.rb
@@ -954,6 +949,9 @@ test_files:
954
949
  - spec/app/models/song.rb
955
950
  - spec/app/models/sound.rb
956
951
  - spec/app/models/square.rb
952
+ - spec/app/models/staff.rb
953
+ - spec/app/models/store_as_dup_test1.rb
954
+ - spec/app/models/store_as_dup_test2.rb
957
955
  - spec/app/models/strategy.rb
958
956
  - spec/app/models/sub_item.rb
959
957
  - spec/app/models/subscription.rb
@@ -984,8 +982,6 @@ test_files:
984
982
  - spec/app/models/word_origin.rb
985
983
  - spec/app/models/writer.rb
986
984
  - spec/config/mongoid.yml
987
- - spec/helpers.rb
988
- - spec/mongoid/#atomic_spec.rb#
989
985
  - spec/mongoid/atomic/modifiers_spec.rb
990
986
  - spec/mongoid/atomic/paths/embedded/many_spec.rb
991
987
  - spec/mongoid/atomic/paths/embedded/one_spec.rb
@@ -996,6 +992,9 @@ test_files:
996
992
  - spec/mongoid/attributes/readonly_spec.rb
997
993
  - spec/mongoid/attributes_spec.rb
998
994
  - spec/mongoid/changeable_spec.rb
995
+ - spec/mongoid/clients/factory_spec.rb
996
+ - spec/mongoid/clients/options_spec.rb
997
+ - spec/mongoid/clients_spec.rb
999
998
  - spec/mongoid/composable_spec.rb
1000
999
  - spec/mongoid/config/environment_spec.rb
1001
1000
  - spec/mongoid/config/options_spec.rb
@@ -1003,13 +1002,11 @@ test_files:
1003
1002
  - spec/mongoid/contextual/aggregable/memory_spec.rb
1004
1003
  - spec/mongoid/contextual/aggregable/mongo_spec.rb
1005
1004
  - spec/mongoid/contextual/atomic_spec.rb
1006
- - spec/mongoid/contextual/find_and_modify_spec.rb
1007
1005
  - spec/mongoid/contextual/geo_near_spec.rb
1008
1006
  - spec/mongoid/contextual/map_reduce_spec.rb
1009
1007
  - spec/mongoid/contextual/memory_spec.rb
1010
1008
  - spec/mongoid/contextual/mongo_spec.rb
1011
1009
  - spec/mongoid/contextual/none_spec.rb
1012
- - spec/mongoid/contextual/text_search_spec.rb
1013
1010
  - spec/mongoid/copyable_spec.rb
1014
1011
  - spec/mongoid/criteria/findable_spec.rb
1015
1012
  - spec/mongoid/criteria/inspectable_spec.rb
@@ -1039,18 +1036,18 @@ test_files:
1039
1036
  - spec/mongoid/errors/invalid_storage_options_spec.rb
1040
1037
  - spec/mongoid/errors/invalid_time_spec.rb
1041
1038
  - spec/mongoid/errors/inverse_not_found_spec.rb
1039
+ - spec/mongoid/errors/mixed_client_configuration_spec.rb
1042
1040
  - spec/mongoid/errors/mixed_relations_spec.rb
1043
- - spec/mongoid/errors/mixed_session_configuration_spec.rb
1044
1041
  - spec/mongoid/errors/mongoid_error_spec.rb
1045
1042
  - spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb
1043
+ - spec/mongoid/errors/no_client_config_spec.rb
1044
+ - spec/mongoid/errors/no_client_database_spec.rb
1045
+ - spec/mongoid/errors/no_client_hosts_spec.rb
1046
+ - spec/mongoid/errors/no_clients_config_spec.rb
1046
1047
  - spec/mongoid/errors/no_environment_spec.rb
1047
1048
  - spec/mongoid/errors/no_map_reduce_output_spec.rb
1048
1049
  - spec/mongoid/errors/no_metadata_spec.rb
1049
1050
  - spec/mongoid/errors/no_parent_spec.rb
1050
- - spec/mongoid/errors/no_session_config_spec.rb
1051
- - spec/mongoid/errors/no_session_database_spec.rb
1052
- - spec/mongoid/errors/no_session_hosts_spec.rb
1053
- - spec/mongoid/errors/no_sessions_config_spec.rb
1054
1051
  - spec/mongoid/errors/readonly_attribute_spec.rb
1055
1052
  - spec/mongoid/errors/readonly_document_spec.rb
1056
1053
  - spec/mongoid/errors/scope_overwrite_spec.rb
@@ -1094,7 +1091,6 @@ test_files:
1094
1091
  - spec/mongoid/indexable_spec.rb
1095
1092
  - spec/mongoid/inspectable_spec.rb
1096
1093
  - spec/mongoid/interceptable_spec.rb
1097
- - spec/mongoid/log_subscriber_spec.rb
1098
1094
  - spec/mongoid/loggable_spec.rb
1099
1095
  - spec/mongoid/matchable/all_spec.rb
1100
1096
  - spec/mongoid/matchable/and_spec.rb
@@ -1125,7 +1121,6 @@ test_files:
1125
1121
  - spec/mongoid/persistable/updatable_spec.rb
1126
1122
  - spec/mongoid/persistable/upsertable_spec.rb
1127
1123
  - spec/mongoid/persistable_spec.rb
1128
- - spec/mongoid/positional_spec.rb
1129
1124
  - spec/mongoid/query_cache_spec.rb
1130
1125
  - spec/mongoid/railties/document_spec.rb
1131
1126
  - spec/mongoid/relations/accessors_spec.rb
@@ -1183,10 +1178,6 @@ test_files:
1183
1178
  - spec/mongoid/scopable_spec.rb
1184
1179
  - spec/mongoid/selectable_spec.rb
1185
1180
  - spec/mongoid/serializable_spec.rb
1186
- - spec/mongoid/sessions/factory_spec.rb
1187
- - spec/mongoid/sessions/mongo_uri_spec.rb
1188
- - spec/mongoid/sessions/options_spec.rb
1189
- - spec/mongoid/sessions_spec.rb
1190
1181
  - spec/mongoid/shardable_spec.rb
1191
1182
  - spec/mongoid/stateful_spec.rb
1192
1183
  - spec/mongoid/tasks/database_rake_spec.rb
@@ -1209,3 +1200,5 @@ test_files:
1209
1200
  - spec/mongoid_spec.rb
1210
1201
  - spec/rails/mongoid_spec.rb
1211
1202
  - spec/spec_helper.rb
1203
+ - spec/support/authorization.rb
1204
+ - spec/support/expectations.rb