Commit ee93f13c authored by Kerri Miller's avatar Kerri Miller

Merge branch 'issue_324629_diff_positionable_note' into 'master'

Fix Gitlab/DelegatePredicateMethods offenses

See merge request gitlab-org/gitlab!76002
parents 70a1dc76 595e28bf
......@@ -4,7 +4,6 @@ Gitlab/DelegatePredicateMethods:
- app/models/clusters/cluster.rb
- app/models/clusters/platforms/kubernetes.rb
- app/models/concerns/ci/metadatable.rb
- app/models/concerns/diff_positionable_note.rb
- app/models/concerns/integrations/base_data_fields.rb
- app/models/concerns/resolvable_discussion.rb
- app/models/project.rb
......
......@@ -3,7 +3,6 @@ module DiffPositionableNote
extend ActiveSupport::Concern
included do
delegate :on_text?, :on_image?, to: :position, allow_nil: true
before_validation :set_original_position, on: :create
before_validation :update_position, on: :create, if: :on_text?, unless: :importing?
......@@ -34,6 +33,14 @@ module DiffPositionableNote
end
end
def on_text?
!!position&.on_text?
end
def on_image?
!!position&.on_image?
end
def supported?
for_commit? || self.noteable.has_complete_diff_refs?
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment