Do not display duplicate entries

This commit is contained in:
Petko Bordjukov 2017-10-23 01:30:15 +03:00
parent 29dd83c7b4
commit aefe919b98
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ class Public::ConferenceFeedbacksController < Public::ApplicationController
@unrated_events = @conference.events
.joins(:proposition).approved
.joins('LEFT JOIN feedbacks ON feedbacks.feedback_receiving_id = events.id AND feedbacks.feedback_receiving_type = \'Event\'')
.where('feedbacks.session_id != ? OR feedbacks.id IS NULL', session.id)
.where('feedbacks.session_id != ? OR feedbacks.id IS NULL', session.id).distinct
@rated_events = @conference.events
.joins(:proposition).approved