Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormicael.bergeron <micael.bergeron@solutionstlm.com>2017-08-29 16:46:40 +0300
committermicael.bergeron <micael.bergeron@solutionstlm.com>2017-09-06 16:00:57 +0300
commit65bcd141c883b1efd9518ff5f588e1dcb1d80f64 (patch)
tree21507da44c611c2a8cfeb0b64e4163374b6f2451 /app/models/note.rb
parent4130552b421f1b83e60f03715000efe56461fc6b (diff)
add controller spec
also fix some code styling issues
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index b1fe60aa387..f44590e2144 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -47,7 +47,7 @@ class Note < ActiveRecord::Base
# A special role that may be displayed on issuable's discussions
attr_accessor :special_role
-
+
default_value_for :system, false
attr_mentionable :note, pipeline: :note
@@ -233,15 +233,12 @@ class Note < ActiveRecord::Base
self.class.has_special_role?(role, self)
end
- def specialize!(role)
- self.special_role = role if !block_given? || yield(self)
- end
-
def specialize_for_first_contribution!(noteable)
return unless noteable.author_id == self.author_id
- specialize!(Note::SpecialRole::FIRST_TIME_CONTRIBUTOR)
+
+ self.special_role = Note::SpecialRole::FIRST_TIME_CONTRIBUTOR
end
-
+
def editable?
!system?
end