Add PollPartialResultOptionFinder to extend PollOptionFinder
Introduce a dedicated finder for partial results, reusing the logic of PollOptionFinder. This will be used in rake tasks to avoid code duplication and make the intent clearer.
This commit is contained in:
7
app/lib/poll_partial_result_option_finder.rb
Normal file
7
app/lib/poll_partial_result_option_finder.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class PollPartialResultOptionFinder < PollOptionFinder
|
||||
private
|
||||
|
||||
def existing_choices
|
||||
question.partial_results.where(option_id: nil).distinct.pluck(:answer)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user