Files
grecia/app/lib/poll_partial_result_option_finder.rb
taitus c9fb47aa3d 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.
2025-09-26 15:05:40 +02:00

8 lines
180 B
Ruby

class PollPartialResultOptionFinder < PollOptionFinder
private
def existing_choices
question.partial_results.where(option_id: nil).distinct.pluck(:answer)
end
end