From b18d3056b3e6436c0ae58e9354c78cc57cd354a8 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 16 Sep 2022 16:25:19 +0100 Subject: [PATCH] WIP --- app/controllers/form_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/form_controller.rb b/app/controllers/form_controller.rb index 3ed641b51..78c9d0fbd 100644 --- a/app/controllers/form_controller.rb +++ b/app/controllers/form_controller.rb @@ -142,14 +142,14 @@ private def find_resource_by_named_id @log = if params[:sales_log_id].present? - if new_log_request? - SalesLog.new - else current_user.sales_logs.find_by(id: params[:sales_log_id]) - end else if new_log_request? - LettingsLog.new + if request.path.include? ("sales-logs") + SalesLog.new + else + LettingsLog.new + end else current_user.lettings_logs.find_by(id: params[:lettings_log_id]) end