Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5f784701
Commit
5f784701
authored
Oct 29, 2020
by
Ragnar-H
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add push_to_gon_features method
parent
14d97308
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
lib/gitlab/gon_helper.rb
lib/gitlab/gon_helper.rb
+5
-1
No files found.
lib/gitlab/gon_helper.rb
View file @
5f784701
...
@@ -58,9 +58,13 @@ module Gitlab
...
@@ -58,9 +58,13 @@ module Gitlab
# args - Any additional arguments to pass to `Feature.enabled?`. This allows
# args - Any additional arguments to pass to `Feature.enabled?`. This allows
# you to check if a flag is enabled for a particular user.
# you to check if a flag is enabled for a particular user.
def
push_frontend_feature_flag
(
name
,
*
args
,
**
kwargs
)
def
push_frontend_feature_flag
(
name
,
*
args
,
**
kwargs
)
var_name
=
name
.
to_s
.
camelize
(
:lower
)
enabled
=
Feature
.
enabled?
(
name
,
*
args
,
**
kwargs
)
enabled
=
Feature
.
enabled?
(
name
,
*
args
,
**
kwargs
)
push_to_gon_features
(
name
,
enabled
)
end
def
push_to_gon_features
(
name
,
enabled
)
var_name
=
name
.
to_s
.
camelize
(
:lower
)
# Here the `true` argument signals gon that the value should be merged
# Here the `true` argument signals gon that the value should be merged
# into any existing ones, instead of overwriting them. This allows you to
# into any existing ones, instead of overwriting them. This allows you to
# use this method to push multiple feature flags.
# use this method to push multiple feature flags.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment