From 27b3590159be78614f841c0c945cd9ff0155e2a5 Mon Sep 17 00:00:00 2001 From: Sjolus Date: Tue, 29 Jun 2021 15:30:44 +0200 Subject: [PATCH] Update in_sql.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issue #43 Signed-off-by: Johan Sjölin --- lib/fluent/plugin/in_sql.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fluent/plugin/in_sql.rb b/lib/fluent/plugin/in_sql.rb index babec57..8d5fe33 100644 --- a/lib/fluent/plugin/in_sql.rb +++ b/lib/fluent/plugin/in_sql.rb @@ -192,7 +192,9 @@ def start socket: @socket, schema_search_path: @schema_search_path, } - + # This makes the default timezone the local one if it's undefined in the timestamp field itself + ActiveRecord::Base.default_timezone = :local + # creates subclass of ActiveRecord::Base so that it can have different # database configuration from ActiveRecord::Base. @base_model = Class.new(ActiveRecord::Base) do