summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-26 13:50:48 +0200
committerRobert Speicher <rspeicher@gmail.com>2016-05-29 15:03:00 -0400
commit21d0cddd456c03e776a8b30e4695ede94c400792 (patch)
treed5e72a8cf3be922666bbe0fe82c3aec6a8f50866 /app
parent0e613db76d8d6e8521a3b4d546f552c8d184ffa1 (diff)
downloadgitlab-ce-21d0cddd456c03e776a8b30e4695ede94c400792.tar.gz
Do not override foreign attributes in note factory
Diffstat (limited to 'app')
-rw-r--r--app/models/note.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index f10446ca45f..e3e522a8d0f 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -34,7 +34,7 @@ class Note < ActiveRecord::Base
validates :author, presence: true
validate unless: :for_commit? do |note|
- unless note.noteable.try(:project) == project
+ unless note.noteable.try(:project) == note.project
errors.add(:invalid_project, 'Note and noteable project mismatch')
end
end