From aae0bf32a8dfb036d70a288085d0e5df4891a44a Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Thu, 8 Dec 2022 12:29:24 +0000 Subject: [PATCH] refactor: linting --- app/controllers/locations_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index 127c0ec61..be9ee7b41 100644 --- a/app/controllers/locations_controller.rb +++ b/app/controllers/locations_controller.rb @@ -121,11 +121,9 @@ class LocationsController < ApplicationController day = location_params["startdate(3i)"] month = location_params["startdate(2i)"] year = location_params["startdate(1i)"] - if [day, month, year].none?(&:blank?) && Date.valid_date?(year.to_i, month.to_i, day.to_i) - @location.startdate = Time.zone.local(year.to_i, month.to_i, day.to_i) - else - @location.startdate = nil - end + @location.startdate = if [day, month, year].none?(&:blank?) && Date.valid_date?(year.to_i, month.to_i, day.to_i) + Time.zone.local(year.to_i, month.to_i, day.to_i) + end if @location.save(context: :startdate) redirect_to scheme_location_check_answers_path(@scheme, @location, route: params[:route]) else