Remove redundant `with_options` from note validators
This commit is contained in:
parent
bf0b51d252
commit
57b551a19f
|
@ -33,13 +33,11 @@ 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|
|
||||
validate unless: :for_commit? do |note|
|
||||
unless note.noteable.try(:project) == project
|
||||
errors.add(:invalid_project, 'Note and noteable project mismatch')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
mount_uploader :attachment, AttachmentUploader
|
||||
|
||||
|
|
Loading…
Reference in New Issue