File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
activesupport/lib/active_support Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -33,23 +33,26 @@ def unique_id
33
33
end
34
34
35
35
def []( key )
36
- state [ key ]
36
+ if state = @scope . current . active_support_execution_state
37
+ state [ key ]
38
+ end
37
39
end
38
40
39
41
def []=( key , value )
42
+ state = ( @scope . current . active_support_execution_state ||= { } )
40
43
state [ key ] = value
41
44
end
42
45
43
46
def key? ( key )
44
- state . key? ( key )
47
+ @scope . current . active_support_execution_state & .key? ( key )
45
48
end
46
49
47
50
def delete ( key )
48
- state . delete ( key )
51
+ @scope . current . active_support_execution_state & .delete ( key )
49
52
end
50
53
51
54
def clear
52
- state . clear
55
+ @scope . current . active_support_execution_state & .clear
53
56
end
54
57
55
58
def context
@@ -62,11 +65,6 @@ def share_with(other)
62
65
# and streaming should be rethought.
63
66
context . active_support_execution_state = other . active_support_execution_state . dup
64
67
end
65
-
66
- private
67
- def state
68
- context . active_support_execution_state ||= { }
69
- end
70
68
end
71
69
72
70
self . isolation_level = :thread
You can’t perform that action at this time.
0 commit comments