From 1d1c088e5dd4d4b11bca1d39a8bc597d6a44879c Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 10 Feb 2025 07:04:33 -0800 Subject: [PATCH] Fix warnings --- config/application.rb | 2 ++ config/environments/test.rb | 10 +++++----- config/initializers/oj.rb | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 config/initializers/oj.rb diff --git a/config/application.rb b/config/application.rb index 5c0557b..43600bb 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,6 +34,8 @@ module HenseiApi config.active_record.query_log_tags = [:application, :controller, :action, :job] config.active_record.cache_query_log_tags = true + config.active_support.to_time_preserves_timezone = :zone + # API-only application configuration config.api_only = true end diff --git a/config/environments/test.rb b/config/environments/test.rb index 8b5160c..dd39c7a 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -require "active_support/core_ext/integer/time" +require 'active_support/core_ext/integer/time' # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that @@ -9,21 +9,21 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Turn false under Spring and add config.action_view.cache_template_loading = true. - config.cache_classes = true + config.cache_classes = false # Eager loading loads your whole application. When running a single test locally, # this probably isn't necessary. It's a good idea to do in a continuous integration # system, or in some way before deploying your code. - config.eager_load = ENV["CI"].present? + config.eager_load = ENV['CI'].present? # Configure public file server for tests with Cache-Control for performance. config.public_file_server.enabled = true config.public_file_server.headers = { - "Cache-Control" => "public, max-age=#{1.hour.to_i}" + 'Cache-Control' => "public, max-age=#{1.hour.to_i}" } # Show full error reports and disable caching. - config.consider_all_requests_local = true + config.consider_all_requests_local = true config.action_controller.perform_caching = false config.cache_store = :null_store diff --git a/config/initializers/oj.rb b/config/initializers/oj.rb new file mode 100644 index 0000000..5787a7b --- /dev/null +++ b/config/initializers/oj.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +# Explicitly configure Oj to mimic JSON. +Oj::Rails.mimic_JSON