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:
authorDylan Griffith <dyl.griffith@gmail.com>2019-10-17 06:55:04 +0300
committerDylan Griffith <dyl.griffith@gmail.com>2019-10-23 03:29:13 +0300
commit0df265b6600c12fb6ed3d068e92e8e2b3ddf0dab (patch)
tree3aa6565afba460f0c731b2517aa413eeebdd046e /app/policies/note_policy.rb
parentdffeff5520e861dc6e7319b690c573186bbbd22e (diff)
Change Note#to_ability_name to 'note'
This is to be more consistent as there is already a :read_note policy in NotePolicy. To keep other behaviour the same we've introduced a Note#noteable_ability_name that is used anywhere this was expected.
Diffstat (limited to 'app/policies/note_policy.rb')
-rw-r--r--app/policies/note_policy.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/policies/note_policy.rb b/app/policies/note_policy.rb
index b2af6c874c7..dcde8cefa0d 100644
--- a/app/policies/note_policy.rb
+++ b/app/policies/note_policy.rb
@@ -9,7 +9,7 @@ class NotePolicy < BasePolicy
condition(:editable, scope: :subject) { @subject.editable? }
- condition(:can_read_noteable) { can?(:"read_#{@subject.to_ability_name}") }
+ condition(:can_read_noteable) { can?(:"read_#{@subject.noteable_ability_name}") }
condition(:is_visible) { @subject.visible_for?(@user) }