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
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
......
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