From 29dd83c7b45d9639f8c22ea0f27ea2170805bedc Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Mon, 23 Oct 2017 00:46:56 +0300 Subject: [PATCH] Prefill email if previous feedback for the session exists --- app/controllers/public/conference_feedbacks_controller.rb | 1 + app/controllers/public/event_feedbacks_controller.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/public/conference_feedbacks_controller.rb b/app/controllers/public/conference_feedbacks_controller.rb index 48a2bef..9b76e83 100644 --- a/app/controllers/public/conference_feedbacks_controller.rb +++ b/app/controllers/public/conference_feedbacks_controller.rb @@ -18,6 +18,7 @@ class Public::ConferenceFeedbacksController < Public::ApplicationController @feedback = current_conference.feedbacks.where(session_id: session.id).order(updated_at: :asc).last else @feedback = current_conference.feedbacks.build + @feedback.author_email = Feedback.where(session_id: session.id).order(updated_at: :asc).last.try(:author_email) end end diff --git a/app/controllers/public/event_feedbacks_controller.rb b/app/controllers/public/event_feedbacks_controller.rb index 358d732..4953d39 100644 --- a/app/controllers/public/event_feedbacks_controller.rb +++ b/app/controllers/public/event_feedbacks_controller.rb @@ -4,6 +4,7 @@ class Public::EventFeedbacksController < Public::ApplicationController @feedback = event.feedbacks.where(session_id: session.id).order(updated_at: :asc).last else @feedback = event.feedbacks.build + @feedback.author_email = Feedback.where(session_id: session.id).order(updated_at: :asc).last.try(:author_email) end end