diff --git a/app/controllers/observations_controller/new_and_create.rb b/app/controllers/observations_controller/new_and_create.rb index bbb2855bdb..c68b69d6ac 100644 --- a/app/controllers/observations_controller/new_and_create.rb +++ b/app/controllers/observations_controller/new_and_create.rb @@ -98,15 +98,15 @@ def add_field_slip_project(code) public def create - logger.warn("ObservationsController#create: #{Time.zone.now}") + logger.warn("ObservationsController#create: #{our_time}") @observation = create_observation_object(params[:observation]) - logger.warn("create_observation_object: #{Time.zone.now}") + logger.warn("create_observation_object: #{our_time}") # set these again, in case they are not defined init_license_var init_new_image_var(Time.zone.now) rough_cut(params) - logger.warn("rough_cut: #{Time.zone.now}") + logger.warn("rough_cut: #{our_time}") success = true success = false unless validate_params(params) success = false unless validate_object(@observation) @@ -115,16 +115,16 @@ def create success = false if @name && !@vote.value.nil? && !validate_object(@vote) success = false if @bad_images != [] success = false if success && !save_observation(@observation) - logger.warn("save_observation: #{Time.zone.now}") + logger.warn("save_observation: #{our_time}") return reload_new_form(params.dig(:naming, :reasons)) unless success @observation.log(:log_observation_created) - logger.warn("log_observation_created: #{Time.zone.now}") + logger.warn("log_observation_created: #{our_time}") save_everything_else(params.dig(:naming, :reasons)) strip_images! if @observation.gps_hidden update_field_slip(@observation, params[:field_code]) flash_notice(:runtime_observation_success.t(id: @observation.id)) - logger.warn("runtime_observation_success: #{Time.zone.now}") + logger.warn("runtime_observation_success: #{our_time}") redirect_to_next_page end @@ -172,23 +172,29 @@ def rough_cut(params) @naming = Naming.construct({}, @observation) @vote = Vote.construct(params.dig(:naming, :vote), @naming) @good_images = update_good_images(params[:good_images]) + logger.warn("update_good_images: #{our_time}") @bad_images = create_image_objects(params[:image], @observation, @good_images) + logger.warn("create_image_objects: #{our_time}") end def save_everything_else(reason) update_naming(reason) - logger.warn("update_naming: #{Time.zone.now}") + logger.warn("update_naming: #{our_time}") attach_good_images(@observation, @good_images) - logger.warn("attach_good_images: #{Time.zone.now}") + logger.warn("attach_good_images: #{our_time}") update_projects(@observation, params[:project]) - logger.warn("update_projects: #{Time.zone.now}") + logger.warn("update_projects: #{our_time}") update_species_lists(@observation, params[:list]) - logger.warn("update_species_lists: #{Time.zone.now}") + logger.warn("update_species_lists: #{our_time}") save_collection_number(@observation, params) - logger.warn("save_collection_number: #{Time.zone.now}") + logger.warn("save_collection_number: #{our_time}") save_herbarium_record(@observation, params) - logger.warn("save_herbarium_record: #{Time.zone.now}") + logger.warn("save_herbarium_record: #{our_time}") + end + + def our_time + Time.zone.now.strftime("%H:%M:%S:%3N") end def update_naming(reason)