Allow giving feedback for events of old editions of the current conference

This commit is contained in:
Petko Bordjukov 2018-11-24 11:21:22 +02:00
parent 1e0f1e205f
commit 79fae723f0
2 changed files with 3 additions and 1 deletions

View File

@ -32,6 +32,6 @@ class Public::EventFeedbacksController < Public::ApplicationController
end end
def approved_events def approved_events
current_conference.events.joins(:proposition).approved current_conference.events_of_all_editions.joins(:proposition).approved
end end
end end

View File

@ -23,6 +23,8 @@ class Conference < ActiveRecord::Base
has_many :participant_profiles, class_name: 'PersonalProfile' has_many :participant_profiles, class_name: 'PersonalProfile'
has_many :slots, through: :halls has_many :slots, through: :halls
has_many :feedbacks, as: :feedback_receiving, dependent: :destroy 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, accepts_nested_attributes_for :tracks, :halls, :event_types, :volunteer_teams,
reject_if: :all_blank, allow_destroy: true reject_if: :all_blank, allow_destroy: true