Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qpixel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Answers
Qpixel
Commits
37f0f396
Commit
37f0f396
authored
Dec 14, 2020
by
ArtOfCode-
Browse files
Options
Downloads
Patches
Plain Diff
Add returns
parent
8b69b355
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/posts_controller.rb
+4
-1
4 additions, 1 deletion
app/controllers/posts_controller.rb
with
4 additions
and
1 deletion
app/controllers/posts_controller.rb
+
4
−
1
View file @
37f0f396
...
...
@@ -16,15 +16,18 @@ class PostsController < ApplicationController
if
@post_type
.
has_parent?
&&
@parent
.
nil?
flash
[
:danger
]
=
helpers
.
i18ns
(
'posts.type_requires_parent'
,
type:
@post_type
.
name
)
redirect_back
fallback_location:
root_path
return
end
if
@post_type
.
has_category?
&&
@category
.
nil?
&&
@parent
.
nil?
flash
[
:danger
]
=
helpers
.
i18ns
(
'posts.type_requires_category'
,
type:
@post_type
.
name
)
redirect_back
fallback_location:
root_path
return
end
if
[
'HelpDoc'
,
'PolicyDoc'
].
include?
(
@post_type
.
name
)
check_permissions
# || return if you add more code after this
check_permissions
# return # uncomment if you add more code after this
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment