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
1d602c5f
Commit
1d602c5f
authored
Sep 09, 2020
by
Dmitry Gruzd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize issues_controller actions arrays
parent
a4fe586d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+5
-10
No files found.
app/controllers/projects/issues_controller.rb
View file @
1d602c5f
...
@@ -10,13 +10,8 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -10,13 +10,8 @@ class Projects::IssuesController < Projects::ApplicationController
include
SpammableActions
include
SpammableActions
include
RecordUserLastActivity
include
RecordUserLastActivity
def
issue_except_actions
ISSUES_EXCEPT_ACTIONS
=
%i[index calendar new create bulk_update import_csv export_csv service_desk]
.
freeze
%i[index calendar new create bulk_update import_csv export_csv service_desk]
SET_ISSUEABLES_INDEX_ONLY_ACTIONS
=
%i[index calendar service_desk]
.
freeze
end
def
set_issuables_index_only_actions
%i[index calendar service_desk]
end
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:index
])
{
authenticate_sessionless_user!
(
:rss
)
}
prepend_before_action
(
only:
[
:calendar
])
{
authenticate_sessionless_user!
(
:ics
)
}
prepend_before_action
(
only:
[
:calendar
])
{
authenticate_sessionless_user!
(
:ics
)
}
...
@@ -25,10 +20,10 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -25,10 +20,10 @@ class Projects::IssuesController < Projects::ApplicationController
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:check_issues_available!
before_action
:check_issues_available!
before_action
:issue
,
unless:
->
(
c
)
{
c
.
issue_except_actions
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:issue
,
unless:
->
(
c
)
{
ISSUES_EXCEPT_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
after_action
:log_issue_show
,
unless:
->
(
c
)
{
c
.
issue_except_actions
.
include?
(
c
.
action_name
.
to_sym
)
}
after_action
:log_issue_show
,
unless:
->
(
c
)
{
ISSUES_EXCEPT_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:set_issuables_index
,
if:
->
(
c
)
{
c
.
set_issuables_index_only_actions
.
include?
(
c
.
action_name
.
to_sym
)
}
before_action
:set_issuables_index
,
if:
->
(
c
)
{
SET_ISSUEABLES_INDEX_ONLY_ACTIONS
.
include?
(
c
.
action_name
.
to_sym
)
}
# Allow write(create) issue
# Allow write(create) issue
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
before_action
:authorize_create_issue!
,
only:
[
:new
,
:create
]
...
...
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