summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-08-17 19:26:45 +0200
committerDouwe Maan <douwe@selenight.nl>2017-08-17 19:26:45 +0200
commit5f758aff57dc54df7d92d0fb63e706d58cf1093d (patch)
tree5eb0e5f786e37c2f8e72a6dea13fac0408da982e /app/models/note.rb
parent9c22974cd14f41ed156ced0a6742dbae7412b0db (diff)
downloadgitlab-ce-5f758aff57dc54df7d92d0fb63e706d58cf1093d.tar.gz
Prefer polymorphism over `is_a?`
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index aa8e03ce302..d807d5ad618 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -300,12 +300,12 @@ class Note < ActiveRecord::Base
end
def expire_etag_cache
- return unless for_issue?
+ return unless noteable.discussions_rendered_on_frontend?
key = Gitlab::Routing.url_helpers.project_noteable_notes_path(
- noteable.project,
+ project,
target_type: noteable_type.underscore,
- target_id: noteable.id
+ target_id: noteable_id
)
Gitlab::EtagCaching::Store.new.touch(key)
end