Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Privacy
Imprint
Contact
Login methods
Sign in
Toggle navigation
Menu
Open sidebar
projects.thm.de
GitLab
Commits
32811d98
Commit
32811d98
authored
May 09, 2016
by
Felipe Artur
Browse files
Make model sanitization methods one liners
parent
d028863e
Changes
3
Hide whitespace changes
Inline
Side-by-side
CHANGELOG
View file @
32811d98
...
...
@@ -10,6 +10,7 @@ v 8.8.0 (unreleased)
- Add 'l' shortcut to open Label dropdown on issuables and 'i' to create new issue on a project
- Updated search UI
- Display informative message when new milestone is created
- Sanitize milestones and labels titles
- Allow "NEWS" and "CHANGES" as alternative names for CHANGELOG. !3768 (Connor Shea)
- Added button to toggle whitespaces changes on diff view
- Backport GitLab Enterprise support from EE
...
...
app/models/label.rb
View file @
32811d98
...
...
@@ -117,9 +117,8 @@ def text_color
LabelsHelper
::
text_color_for_bg
(
self
.
color
)
end
def
title
=
value
value
=
Sanitize
.
clean
(
value
.
to_s
)
if
value
write_attribute
(
:title
,
Sanitize
.
clean
(
value
))
def
title
=
(
value
)
write_attribute
(
:title
,
Sanitize
.
clean
(
value
.
to_s
))
if
value
.
present?
end
private
...
...
app/models/milestone.rb
View file @
32811d98
...
...
@@ -129,9 +129,8 @@ def author_id
nil
end
def
title
=
value
value
=
Sanitize
.
clean
(
value
.
to_s
)
if
value
write_attribute
(
:title
,
value
)
def
title
=
(
value
)
write_attribute
(
:title
,
Sanitize
.
clean
(
value
.
to_s
))
if
value
.
present?
end
# Sorts the issues for the given IDs.
...
...
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