Browse Source

refactor: linting

pull/1034/head
natdeanlewissoftwire 4 years ago
parent
commit
aae0bf32a8
  1. 6
      app/controllers/locations_controller.rb

6
app/controllers/locations_controller.rb

@ -121,10 +121,8 @@ 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
@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])

Loading…
Cancel
Save