summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-04-26 11:36:50 +0200
committerRobert Speicher <rspeicher@gmail.com>2016-05-29 15:03:00 -0400
commit57b551a19f18d8da78175b4de6098d5517cde49f (patch)
treee5f289b8b6e6cb2f0550bbad9292b88838153122 /app/models/note.rb
parentbf0b51d252e049404a49787c18e5c88071006e15 (diff)
downloadgitlab-ce-57b551a19f18d8da78175b4de6098d5517cde49f.tar.gz
Remove redundant `with_options` from note validators
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 02a98a37117..f10446ca45f 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -33,11 +33,9 @@ class Note < ActiveRecord::Base
validates :commit_id, presence: true, if: :for_commit?
validates :author, presence: true
- with_options unless: :for_commit? do
- validate do |note|
- unless note.noteable.try(:project) == project
- errors.add(:invalid_project, 'Note and noteable project mismatch')
- end
+ validate unless: :for_commit? do |note|
+ unless note.noteable.try(:project) == project
+ errors.add(:invalid_project, 'Note and noteable project mismatch')
end
end