From 8a0ce67daad7cb2b3c41ec8f5e0873b5454700f0 Mon Sep 17 00:00:00 2001 From: Nishanth Vijayan Date: Wed, 16 Nov 2016 12:55:00 +0530 Subject: [PATCH] Check if commercial has versions before displaying commercial creator --- app/views/proposals/_form.html.haml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/proposals/_form.html.haml b/app/views/proposals/_form.html.haml index 3729e675..fe966ed1 100644 --- a/app/views/proposals/_form.html.haml +++ b/app/views/proposals/_form.html.haml @@ -40,6 +40,7 @@ - if can? :destroy, commercial = link_to 'Delete', conference_program_proposal_commercial_path(@conference.short_title, @event.id, commercial.id), :method => :delete, :data => { :confirm => 'Are you sure?' }, class: 'btn btn-danger' - .text-right - = "added by " - = link_to_user(commercial.versions.last.whodunnit) + - if commercial.versions.any? + .text-right + = "added by " + = link_to_user(commercial.versions.last.whodunnit)