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:
parent
4f5d0f1b96
commit
0a4c31d39e
|
@ -91,9 +91,10 @@ class Poll extends ImmutablePureComponent {
|
||||||
flexRow: 1,
|
flexRow: 1,
|
||||||
py10: showResults,
|
py10: showResults,
|
||||||
mb10: 1,
|
mb10: 1,
|
||||||
border1PX: !showResults,
|
border1PX: !showResults || !!me,
|
||||||
borderColorSecondary: !showResults,
|
borderColorSecondary: !showResults || !!me,
|
||||||
circle: !showResults,
|
circle: !showResults || !!me,
|
||||||
|
overflowHidden: !!me,
|
||||||
cursorPointer: !showResults,
|
cursorPointer: !showResults,
|
||||||
bgSubtle_onHover: !showResults,
|
bgSubtle_onHover: !showResults,
|
||||||
bgSubtle: !showResults && active,
|
bgSubtle: !showResults && active,
|
||||||
|
|
|
@ -91,6 +91,6 @@ class Poll < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def show_totals_now?
|
def show_totals_now?
|
||||||
expired?
|
expired? || !hide_totals?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,7 @@ class REST::PollSerializer < ActiveModel::Serializer
|
||||||
attributes :id, :expires_at, :expired,
|
attributes :id, :expires_at, :expired,
|
||||||
:multiple, :votes_count
|
:multiple, :votes_count
|
||||||
|
|
||||||
has_many :loaded_options, key: :options
|
has_many :loaded_options, key: :options, serializer: REST::PollOptionSerializer
|
||||||
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
has_many :emojis, serializer: REST::CustomEmojiSerializer
|
||||||
|
|
||||||
attribute :voted, if: :current_user?
|
attribute :voted, if: :current_user?
|
||||||
|
@ -25,7 +25,4 @@ class REST::PollSerializer < ActiveModel::Serializer
|
||||||
!current_user.nil?
|
!current_user.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
class OptionSerializer < ActiveModel::Serializer
|
|
||||||
attributes :title, :votes_count
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue