clickhouse-activerecord 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 42e313d78ebe5e65c9d69dee42e516e2026c381f
4
- data.tar.gz: abe79df94ae67c6ff8777a39f1e2a0fa1ddeb145
3
+ metadata.gz: c6cf84ba5f26b055c401f57ead0582ac4016f66b
4
+ data.tar.gz: 491d81569bfc86a70b5f084786046727097da075
5
5
  SHA512:
6
- metadata.gz: 76a8b83b2905276ca6be59fe477a7e85ecb6a33ea56c7c9c81d72512f5240dc7c2785f978c494938db824e77381e4bb80e7fd121adb3ca0f2d0b19897b1c64dc
7
- data.tar.gz: 7493d61f0f820585a8de6a6c1b42fb6f4b7c2fccaad85162225e7fec8c045658c72bc2ca7146c99f97a0b5b79bf1a14517e2e025bedbcf0f4bb4ef935a232a12
6
+ metadata.gz: ff8d1629cb46e3bbad4fc9c5f6d873a23e92950b0bb74c9a077795515557201eee2608ee5c2dd953b498e30e39f5f1ec5920e8e4c2c91d1db7c1e8b64d9fc109
7
+ data.tar.gz: a04fac4e14cfd16d935e18ee29cfb3bc733835d15592fb40354e7cf25c7cbca789713af48b63ac138b465ba971334038fa27cec0c8794830366684cbcdc645db
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'clickhouse-activerecord'
8
- spec.version = '0.1.0'
8
+ spec.version = '0.1.1'
9
9
  spec.authors = ['Sergey Odintsov']
10
10
  spec.email = ['nixx.dj@gmail.com']
11
11
 
@@ -11,7 +11,12 @@ module ActiveRecord
11
11
  # Type cast a value for schema dumping. This method is private, as we are
12
12
  # hoping to remove it entirely.
13
13
  def type_cast_for_schema(value) # :nodoc:
14
- value.inspect
14
+ case value
15
+ when 'toDate(now()', 'CAST(now() AS Date)'
16
+ 'now()'.inspect
17
+ else
18
+ value.inspect
19
+ end
15
20
  end
16
21
 
17
22
  end
@@ -2,6 +2,6 @@ require 'active_record/connection_adapters/clickhouse_adapter'
2
2
 
3
3
  require 'clickhouse/railtie' if defined?(Rails::Railtie)
4
4
 
5
- module Clickhouse
5
+ module ClickhouseActiverecord
6
6
 
7
7
  end
@@ -3,11 +3,11 @@ namespace :clickhouse do
3
3
  namespace :schema do
4
4
 
5
5
  # todo not testing
6
- # desc 'Load database schema'
7
- # task load_schema: :environment do
8
- # ActiveRecord::Base.establish_connection(:"#{Rails.env}_clickhouse")
9
- # load("#{Rails.root}/db/clickhouse_schema.rb")
10
- # end
6
+ desc 'Load database schema'
7
+ task load: :environment do
8
+ ActiveRecord::Base.establish_connection(:"#{Rails.env}_clickhouse")
9
+ load("#{Rails.root}/db/clickhouse_schema.rb")
10
+ end
11
11
 
12
12
  desc 'Dump database schema'
13
13
  task dump: :environment do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clickhouse-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Odintsov
@@ -85,7 +85,7 @@ files:
85
85
  - lib/active_record/connection_adapters/clickhouse/oid/date.rb
86
86
  - lib/active_record/connection_adapters/clickhouse/oid/date_time.rb
87
87
  - lib/active_record/connection_adapters/clickhouse_adapter.rb
88
- - lib/clickhouse.rb
88
+ - lib/clickhouse-activerecord.rb
89
89
  - lib/clickhouse/railtie.rb
90
90
  - lib/tasks/clickhouse.rake
91
91
  homepage: https://github.com/pnixx/clickhouse-activerecord