diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-05 15:13:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-05 15:13:40 +0300 |
commit | 7120254aee218529320c061696a2af530494e6aa (patch) | |
tree | c33bc6d9d7881b7ab22bbe09297b2c49aef9a3a9 /lib/gitlab/namespaced_session_store.rb | |
parent | fc23bd54a1a49003eda83bc2331d9b8b8417a91b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/namespaced_session_store.rb')
-rw-r--r-- | lib/gitlab/namespaced_session_store.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/gitlab/namespaced_session_store.rb b/lib/gitlab/namespaced_session_store.rb index f0f24c081c3..957e8fe9b9f 100644 --- a/lib/gitlab/namespaced_session_store.rb +++ b/lib/gitlab/namespaced_session_store.rb @@ -2,10 +2,8 @@ module Gitlab class NamespacedSessionStore - delegate :[], :[]=, to: :store - def initialize(key, session = Session.current) - @key = key + @namespace_key = key @session = session end @@ -13,11 +11,17 @@ module Gitlab !session.nil? end - def store + def [](key) + return unless session + + session[@namespace_key]&.fetch(key, nil) + end + + def []=(key, value) return unless session - session[@key] ||= {} - session[@key] + session[@namespace_key] ||= {} + session[@namespace_key][key] = value end private |