Merge remote-tracking branch 'parent/main' into upstream-20240124

This commit is contained in:
KMY 2024-01-24 08:38:14 +09:00
commit 54f5113b46
106 changed files with 1396 additions and 1071 deletions

View file

@ -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)

View file

@ -35,7 +35,7 @@ class VoteValidator < ActiveModel::Validator
if vote.persisted?
account_votes_on_same_poll(vote).where(choice: vote.choice).where.not(poll_votes: { id: vote }).exists?
else
account_votes_on_same_poll(vote).where(choice: vote.choice).exists?
account_votes_on_same_poll(vote).exists?(choice: vote.choice)
end
end