Class: Gitlab::Sourcegraph

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/sourcegraph.rb

Class Method Summary collapse

Class Method Details

.feature_available?Boolean

Returns:

  • (Boolean)

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

def feature_available?
  # The sourcegraph feature could be conditionally applied, so check if `!off?`
  # We also can't just check !off? because the ActiveRecord might not exist yet
  self.feature_enabled? || !feature.off?
end

.feature_conditional?Boolean

Returns:

  • (Boolean)

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

def feature_conditional?
  feature.conditional?
end

.feature_enabled?(actor = nil) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
19
# File 'lib/gitlab/sourcegraph.rb', line 16

def feature_enabled?(actor = nil)
  # Some CI jobs grep for Feature.enabled? in our codebase, so it is important this reference stays around.
  Feature.enabled?(:sourcegraph, actor)
end