Fix Rails/WhereExists
cop in app/validators (#28854)
This commit is contained in:
parent
e2d9635074
commit
67f54c4e75
3 changed files with 2 additions and 4 deletions
|
@ -19,7 +19,7 @@ class ReactionValidator < ActiveModel::Validator
|
|||
end
|
||||
|
||||
def new_reaction?(reaction)
|
||||
!reaction.announcement.announcement_reactions.where(name: reaction.name).exists?
|
||||
!reaction.announcement.announcement_reactions.exists?(name: reaction.name)
|
||||
end
|
||||
|
||||
def limit_reached?(reaction)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue