diff --git a/app/controllers/public/event_feedbacks_controller.rb b/app/controllers/public/event_feedbacks_controller.rb index 4953d39..fab2938 100644 --- a/app/controllers/public/event_feedbacks_controller.rb +++ b/app/controllers/public/event_feedbacks_controller.rb @@ -32,6 +32,6 @@ class Public::EventFeedbacksController < Public::ApplicationController end def approved_events - current_conference.events.joins(:proposition).approved + current_conference.events_of_all_editions.joins(:proposition).approved end end diff --git a/app/models/conference.rb b/app/models/conference.rb index 4b9532f..7634779 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -23,6 +23,8 @@ class Conference < ActiveRecord::Base has_many :participant_profiles, class_name: 'PersonalProfile' has_many :slots, through: :halls has_many :feedbacks, as: :feedback_receiving, dependent: :destroy + has_many :editions, primary_key: :host_name, foreign_key: :host_name, class_name: 'Conference' + has_many :events_of_all_editions, through: :editions, source: :events accepts_nested_attributes_for :tracks, :halls, :event_types, :volunteer_teams, reject_if: :all_blank, allow_destroy: true