mongoid 7.3.4 → 7.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/mongoid/association/embedded/batchable.rb +20 -3
- data/lib/mongoid/association/referenced/has_many/proxy.rb +2 -2
- data/lib/mongoid/atomic/paths/embedded/many.rb +19 -0
- data/lib/mongoid/criteria/queryable/storable.rb +1 -1
- data/lib/mongoid/persistable/upsertable.rb +1 -1
- data/lib/mongoid/version.rb +1 -1
- data/lib/rails/generators/mongoid/config/templates/mongoid.yml +7 -2
- data/spec/lite_spec_helper.rb +8 -1
- data/spec/mongoid/association/embedded/embeds_many/proxy_spec.rb +21 -0
- data/spec/mongoid/association/embedded/embeds_many_models.rb +137 -0
- data/spec/mongoid/association/referenced/has_and_belongs_to_many/proxy_spec.rb +8 -0
- data/spec/mongoid/association/referenced/has_many/proxy_spec.rb +24 -8
- data/spec/mongoid/criteria_spec.rb +32 -0
- data/spec/mongoid/query_cache_spec.rb +2 -2
- data/spec/mongoid/scopable_spec.rb +11 -0
- data/spec/shared/lib/mrss/cluster_config.rb +6 -1
- data/spec/shared/lib/mrss/session_registry.rb +69 -0
- data/spec/shared/lib/mrss/session_registry_legacy.rb +60 -0
- data/spec/shared/share/Dockerfile.erb +3 -3
- data/spec/shared/shlib/server.sh +1 -1
- data/spec/support/models/audible_sound.rb +3 -0
- data.tar.gz.sig +0 -0
- metadata +581 -577
- metadata.gz.sig +2 -3
- data/spec/support/session_registry.rb +0 -50
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�K9�z�*��̗ uf4V>�ZLo#����_���9N�/(����/Uy��
|
1
|
+
t��1?��h�q4Ng��81��S$_V���逜P���x�Яm�OU��|g�\��)��
|
2
|
+
f6&��4A��� �أj@ �M�B�Oi�t�\�2�v�PyMCn��!�&xч���$TK�?���"���2�z���㵺]���3���l*�����(����H-���.)n�4��d=�Te��Xl�-�.pP��q����_kP����Y�Uh��y:��
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'singleton'
|
2
|
-
|
3
|
-
module Mongo
|
4
|
-
class Client
|
5
|
-
alias :get_session_without_tracking :get_session
|
6
|
-
|
7
|
-
def get_session(options = {})
|
8
|
-
get_session_without_tracking(options).tap do |session|
|
9
|
-
SessionRegistry.instance.register(session)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Session
|
15
|
-
alias :end_session_without_tracking :end_session
|
16
|
-
|
17
|
-
def end_session
|
18
|
-
SessionRegistry.instance.unregister(self)
|
19
|
-
end_session_without_tracking
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
|
-
class SessionRegistry
|
26
|
-
include Singleton
|
27
|
-
|
28
|
-
def initialize
|
29
|
-
@registry = {}
|
30
|
-
end
|
31
|
-
|
32
|
-
def register(session)
|
33
|
-
@registry[session.session_id] = session if session
|
34
|
-
end
|
35
|
-
|
36
|
-
def unregister(session)
|
37
|
-
@registry.delete(session.session_id)
|
38
|
-
end
|
39
|
-
|
40
|
-
def verify_sessions_ended!
|
41
|
-
unless @registry.empty?
|
42
|
-
sessions = @registry.map { |_, session| session }
|
43
|
-
raise "Session registry contains live sessions: #{sessions.join(', ')}"
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def clear_registry
|
48
|
-
@registry = {}
|
49
|
-
end
|
50
|
-
end
|