2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Notes
|
|
|
|
class BaseService < ::BaseService
|
|
|
|
def clear_noteable_diffs_cache(note)
|
|
|
|
if note.is_a?(DiffNote) &&
|
2020-01-01 13:55:28 +05:30
|
|
|
note.start_of_discussion? &&
|
2018-12-13 13:39:08 +05:30
|
|
|
note.position.unfolded_diff?(project.repository)
|
|
|
|
note.noteable.diffs.clear_cache
|
|
|
|
end
|
|
|
|
end
|
2019-10-12 21:52:04 +05:30
|
|
|
|
|
|
|
def increment_usage_counter(note)
|
|
|
|
Gitlab::UsageDataCounters::NoteCounter.count(:create, note.noteable_type)
|
|
|
|
end
|
2018-12-13 13:39:08 +05:30
|
|
|
end
|
|
|
|
end
|