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:
authorBob Van Landuyt <bob@vanlanduyt.co>2019-06-03 17:41:05 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2019-06-03 17:41:05 +0300
commit4504959aa6ce6667b9fd5b68ff24a612cb7c027b (patch)
treebe88c9ff22e0ec8ac6af5c31bca7e4f2f318c62c /app/models/diff_note.rb
parent2ad5b30b6c02a3e3f84275121a709f5de75dac48 (diff)
Make `resolvable_types` a class method
This turns Notable::RESOLVABLE_TYPES into a `Notable.resolvable_types`. That allows us to override it in EE.
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r--app/models/diff_note.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb
index feabea9b8ba..d4d163f2f38 100644
--- a/app/models/diff_note.rb
+++ b/app/models/diff_note.rb
@@ -15,7 +15,9 @@ class DiffNote < Note
validates :original_position, presence: true
validates :position, presence: true
validates :line_code, presence: true, line_code: true, if: :on_text?
- validates :noteable_type, inclusion: { in: noteable_types }
+ # We need to evaluate the `noteable` types when running the validation since
+ # EE might have added a type when the module was prepended
+ validates :noteable_type, inclusion: { in: -> (_note) { noteable_types } }
validate :positions_complete
validate :verify_supported
validate :diff_refs_match_commit, if: :for_commit?