Module: Gitlab::CurrentSettings

Defined in:
lib/gitlab/current_settings.rb

Class Method Summary collapse

Class Method Details

.clear_in_memory_application_settings!Object


15
16
17
# File 'lib/gitlab/current_settings.rb', line 15

def clear_in_memory_application_settings!
  @in_memory_application_settings = nil
end

.current_application_settingsObject


6
7
8
# File 'lib/gitlab/current_settings.rb', line 6

def current_application_settings
  Gitlab::SafeRequestStore.fetch(:current_application_settings) { ensure_application_settings! }
end

.expire_current_application_settingsObject


10
11
12
13
# File 'lib/gitlab/current_settings.rb', line 10

def expire_current_application_settings
  ::ApplicationSetting.expire
  Gitlab::SafeRequestStore.delete(:current_application_settings)
end

.method_missing(name, *args, &block) ⇒ Object


19
20
21
# File 'lib/gitlab/current_settings.rb', line 19

def method_missing(name, *args, &block)
  current_application_settings.send(name, *args, &block) # rubocop:disable GitlabSecurity/PublicSend
end

.respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)

23
24
25
# File 'lib/gitlab/current_settings.rb', line 23

def respond_to_missing?(name, include_private = false)
  current_application_settings.respond_to?(name, include_private) || super
end