clickhouse-activerecord 0.5.14 → 0.5.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ff54c1e4a5da2543e1a64ad8002822bf82ba5d3b6f7f74f00f1cb0ce23679dd
4
- data.tar.gz: 61158e185f4617e88701d2a9b1d261ddf7b4f9c7617454e66a899d55900a34a8
3
+ metadata.gz: 6534694860bbb41c21789239e0589406bcbef64bc1750645c68485e77acb7310
4
+ data.tar.gz: c6640ccc74004a93bfaa18d93dd1c135411d66f27273eb65848f9843f64fd6d0
5
5
  SHA512:
6
- metadata.gz: 2d690a0cf443ce6e1b3f90e0443263e27b44be546fd080c11c8aa0278d6f630360371057880e667d4f5f76e31ac9bccf1b71fdfffeda09aa7d4d9a49af786f79
7
- data.tar.gz: f0f96caa0371b8206cee957e38b9f24993549eaa2dcc03265d4b398e051a0a9ebe32a7262c949bf4510dda3f843d8e9e2bb2437cc364dd9bf06f5a622e085530
6
+ metadata.gz: f848ad57f80f061aa85a593a90bff65707e8dbe281caf3f4a41914d93a4723351bf7e5ca12bfdc7c8ed2cbed5df3db39472b8d015645875476b68941d7de6111
7
+ data.tar.gz: 1592560741198e983d43599ff78b145262e0638951a2825dcaac993e0dcc0195bf85980b5eeff80d973e0573aeaa865d6d6c8acdd7ee2b2b1ba6bb6740e734cf
@@ -9,9 +9,8 @@ module ActiveRecord
9
9
  def serialize(value)
10
10
  value = super
11
11
  return unless value
12
- return value.strftime('%Y-%m-%d %H:%M:%S') unless value.acts_like?(:time)
13
12
 
14
- value.to_time.strftime('%Y-%m-%d %H:%M:%S')
13
+ value.strftime('%Y-%m-%d %H:%M:%S' + (@precision.present? && @precision > 0 ? ".%#{@precision}N" : ''))
15
14
  end
16
15
 
17
16
  def type_cast_from_database(value)
@@ -191,7 +191,7 @@ module ActiveRecord
191
191
  super
192
192
  register_class_with_limit m, %r(String), Type::String
193
193
  register_class_with_limit m, 'Date', Clickhouse::OID::Date
194
- register_class_with_limit m, 'DateTime', Clickhouse::OID::DateTime
194
+ register_class_with_precision m, %r(datetime)i, Clickhouse::OID::DateTime
195
195
 
196
196
  register_class_with_limit m, %r(Int8), Type::Integer
197
197
  register_class_with_limit m, %r(Int16), Type::Integer
@@ -1,3 +1,3 @@
1
1
  module ClickhouseActiverecord
2
- VERSION = '0.5.14'
2
+ VERSION = '0.5.15'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clickhouse-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.14
4
+ version: 0.5.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Odintsov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-02-21 00:00:00.000000000 Z
11
+ date: 2023-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler