Commit 57b551a1 authored by Grzegorz Bizon's avatar Grzegorz Bizon Committed by Robert Speicher

Remove redundant `with_options` from note validators

parent bf0b51d2
...@@ -33,11 +33,9 @@ class Note < ActiveRecord::Base ...@@ -33,11 +33,9 @@ class Note < ActiveRecord::Base
validates :commit_id, presence: true, if: :for_commit? validates :commit_id, presence: true, if: :for_commit?
validates :author, presence: true validates :author, presence: true
with_options unless: :for_commit? do validate unless: :for_commit? do |note|
validate do |note| unless note.noteable.try(:project) == project
unless note.noteable.try(:project) == project errors.add(:invalid_project, 'Note and noteable project mismatch')
errors.add(:invalid_project, 'Note and noteable project mismatch')
end
end end
end 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