summaryrefslogtreecommitdiff
path: root/app/models/milestone.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-05-09 11:58:20 -0300
committerFelipe Artur <felipefac@gmail.com>2016-05-09 12:00:32 -0300
commit32811d98fe2893a0671fe22c4aebf8bd254b7709 (patch)
tree0b2286c17e8f22e7799f9303ddaead35ac87d06f /app/models/milestone.rb
parentd028863eda8b97f6e4db129ef57f0d3a2130c9b3 (diff)
downloadgitlab-ce-32811d98fe2893a0671fe22c4aebf8bd254b7709.tar.gz
Make model sanitization methods one liners
Diffstat (limited to 'app/models/milestone.rb')
-rw-r--r--app/models/milestone.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/models/milestone.rb b/app/models/milestone.rb
index ed81791c69c..15a786210fa 100644
--- a/app/models/milestone.rb
+++ b/app/models/milestone.rb
@@ -129,9 +129,8 @@ class Milestone < ActiveRecord::Base
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.