diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-01 11:23:09 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-01 12:10:08 +0200 |
commit | 91a7b9333b660abc866e52e1a614151cb529413d (patch) | |
tree | c7ee15fd37e703229f6f197207304479251b5856 /app/models/note.rb | |
parent | cbd7801b3d1d435a95ec70032c5acc9df33b0337 (diff) | |
download | gitlab-ce-91a7b9333b660abc866e52e1a614151cb529413d.tar.gz |
Incorportate feedback
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index bbe5545dc80..f99d327a5b8 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -21,10 +21,8 @@ class Note < ActiveRecord::Base delegate :name, :email, to: :author, prefix: true delegate :title, to: :noteable, allow_nil: true - before_validation :clear_blank_line_code! - validates :note, :project, presence: true - validates :line_code, line_code: true, allow_blank: true + # Attachments are deprecated and are handled by Markdown uploader validates :attachment, file_size: { maximum: :max_attachment_size } @@ -173,10 +171,6 @@ class Note < ActiveRecord::Base Event.reset_event_cache_for(self) end - def system? - read_attribute(:system) - end - def editable? !system? end @@ -193,14 +187,8 @@ class Note < ActiveRecord::Base self.line_code = nil if self.line_code.blank? end - # Find the diff on noteable that matches our own - def find_noteable_diff - diffs = noteable.diffs(Commit.max_diff_options) - diffs.find { |d| d.new_path == self.diff.new_path } - end - def award_emoji_supported? - noteable.is_a?(Awardable) && !line_code.present? + noteable.is_a?(Awardable) end def contains_emoji_only? |