From 6d6c4f693a2c0876c89d6ec6dc4c70b3f2763e51 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Mon, 17 Jul 2023 13:09:49 +0200 Subject: [PATCH] Delint --- app/controllers/admin/ticket_scannings_controller.rb | 4 ++-- app/helpers/date_time_helper.rb | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/ticket_scannings_controller.rb b/app/controllers/admin/ticket_scannings_controller.rb index 5d81215e1..3db7794f4 100644 --- a/app/controllers/admin/ticket_scannings_controller.rb +++ b/app/controllers/admin/ticket_scannings_controller.rb @@ -7,14 +7,14 @@ class TicketScanningsController < Admin::BaseController skip_authorize_resource only: [:create] def create - if not @physical_ticket and params[:physical_ticket] + if !@physical_ticket && params[:physical_ticket] @physical_ticket = PhysicalTicket.find_by(token: params[:physical_ticket][:token]) end @ticket_scanning = TicketScanning.new(physical_ticket: @physical_ticket) authorize! :create, @ticket_scanning @ticket_scanning.save dest_path = conferences_path - if request.referer.match?(/admin\/conferences/) + if request.referer.match?(%r{admin/conferences}) dest_path = admin_conference_physical_tickets_path(@conference) end redirect_to dest_path, diff --git a/app/helpers/date_time_helper.rb b/app/helpers/date_time_helper.rb index a9c10e712..24324cf39 100644 --- a/app/helpers/date_time_helper.rb +++ b/app/helpers/date_time_helper.rb @@ -20,6 +20,7 @@ def length_timestamp(length) # * +String+ -> formated datetime object def format_datetime(obj) return unless obj + obj = DateTime.parse(obj) unless ob.respond_to?(:strftime) obj.strftime('%Y-%m-%d %H:%M')