Fixed issue with poll vote counts not showing

• Fixed:
- issue with poll vote counts not showing by not including !hide_totals? in poll.rb
This commit is contained in:
mgabdev 2020-12-22 23:46:43 -05:00
parent 4f5d0f1b96
commit 0a4c31d39e
3 changed files with 6 additions and 8 deletions

View File

@ -91,9 +91,10 @@ class Poll extends ImmutablePureComponent {
flexRow: 1,
py10: showResults,
mb10: 1,
border1PX: !showResults,
borderColorSecondary: !showResults,
circle: !showResults,
border1PX: !showResults || !!me,
borderColorSecondary: !showResults || !!me,
circle: !showResults || !!me,
overflowHidden: !!me,
cursorPointer: !showResults,
bgSubtle_onHover: !showResults,
bgSubtle: !showResults && active,

View File

@ -91,6 +91,6 @@ class Poll < ApplicationRecord
end
def show_totals_now?
expired?
expired? || !hide_totals?
end
end

View File

@ -4,7 +4,7 @@ class REST::PollSerializer < ActiveModel::Serializer
attributes :id, :expires_at, :expired,
:multiple, :votes_count
has_many :loaded_options, key: :options
has_many :loaded_options, key: :options, serializer: REST::PollOptionSerializer
has_many :emojis, serializer: REST::CustomEmojiSerializer
attribute :voted, if: :current_user?
@ -25,7 +25,4 @@ class REST::PollSerializer < ActiveModel::Serializer
!current_user.nil?
end
class OptionSerializer < ActiveModel::Serializer
attributes :title, :votes_count
end
end