Merge pull request #5036 from consul/author_lock
Simplify locking current user when voting
This commit is contained in:
@@ -38,7 +38,6 @@ class Poll::Answer < ApplicationRecord
|
||||
def max_votes
|
||||
return if !question || question&.unique? || persisted?
|
||||
|
||||
author.reload
|
||||
author.lock!
|
||||
|
||||
if question.answers.by_author(author).count >= question.max_votes
|
||||
|
||||
@@ -339,7 +339,7 @@ class User < ApplicationRecord
|
||||
end
|
||||
|
||||
def locale
|
||||
self[:locale] ||= I18n.default_locale.to_s
|
||||
self[:locale] || I18n.default_locale.to_s
|
||||
end
|
||||
|
||||
def confirmation_required?
|
||||
|
||||
Reference in New Issue
Block a user