diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-04-26 11:36:50 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-05-29 15:03:00 -0400 |
commit | 57b551a19f18d8da78175b4de6098d5517cde49f (patch) | |
tree | e5f289b8b6e6cb2f0550bbad9292b88838153122 | |
parent | bf0b51d252e049404a49787c18e5c88071006e15 (diff) | |
download | gitlab-ce-57b551a19f18d8da78175b4de6098d5517cde49f.tar.gz |
Remove redundant `with_options` from note validators
-rw-r--r-- | app/models/note.rb | 8 |
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 |