Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
595e28bf
Commit
595e28bf
authored
Dec 04, 2021
by
Siddharth Asthana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Gitlab/DelegatePredicateMethods offenses
Changelog: other
parent
70a1dc76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
.rubocop_todo/gitlab/delegate_predicate_methods.yml
.rubocop_todo/gitlab/delegate_predicate_methods.yml
+0
-1
app/models/concerns/diff_positionable_note.rb
app/models/concerns/diff_positionable_note.rb
+8
-1
No files found.
.rubocop_todo/gitlab/delegate_predicate_methods.yml
View file @
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
...
...
app/models/concerns/diff_positionable_note.rb
View file @
595e28bf
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment