summaryrefslogtreecommitdiff
path: root/app/models/suggestion.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/suggestion.rb')
-rw-r--r--app/models/suggestion.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/suggestion.rb b/app/models/suggestion.rb
index c76b8e71507..09034646bff 100644
--- a/app/models/suggestion.rb
+++ b/app/models/suggestion.rb
@@ -5,8 +5,7 @@ class Suggestion < ApplicationRecord
validates :note, presence: true
validates :commit_id, presence: true, if: :applied?
- delegate :original_position, :position, :diff_file,
- :noteable, to: :note
+ delegate :original_position, :position, :noteable, to: :note
def project
noteable.source_project
@@ -16,6 +15,10 @@ class Suggestion < ApplicationRecord
noteable.source_branch
end
+ def file_path
+ position.file_path
+ end
+
# For now, suggestions only serve as a way to send patches that
# will change a single line (being able to apply multiple in the same place),
# which explains `from_line` and `to_line` being the same line.