add Poll#associated_shards
This commit adds the Poll#associated_shards method so that with_each_shard acts sane. Test plan - The poll_choices index endpoint should work correctly Change-Id: Iabb0f3db25aec7e60ec1013424b534fa2c08102a Reviewed-on: https://gerrit.instructure.com/36068 Reviewed-by: Derek DeVries <ddevries@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Matt Fairbourn <mfairbourn@instructure.com> Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
This commit is contained in:
parent
66ab0c0b9b
commit
f20f1631ee
|
@ -63,6 +63,10 @@ module Polling
|
|||
results.any?
|
||||
end
|
||||
|
||||
def associated_shards
|
||||
user.associated_shards
|
||||
end
|
||||
|
||||
def total_results
|
||||
poll_sessions.reduce(Hash.new(0)) do |poll_results, session|
|
||||
poll_results = poll_results.merge(session.results) do |key, poll_result_value, session_result_value|
|
||||
|
|
Loading…
Reference in New Issue