activerecord-turntable 4.3.0 → 4.4.0

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: 6d1d03f8216a73b1e732c4c1c22c6eda6d9843661121a2c5c85543ca6da51e32
4
- data.tar.gz: e71f85959d36f0dbb806ed287ba9137a45c30645fdfafbf6d845799ab3de3fc0
3
+ metadata.gz: 0bb7d81afbaa8937a6f248d0b755e7a00da9d5471d5ec235d9c2bf0db14028d9
4
+ data.tar.gz: a67d03e3df1c3084b488f370a517c63e4d209a2590d40602b5ccbff115221997
5
5
  SHA512:
6
- metadata.gz: 2bffbb3be5a6d1ccd5f4fb69a7a6c4af0c41f63f56188e6aee394979d9310f37646243ef3e3b035bf28767a2c25b70d4b10bda9544f0070b232364834476a61f
7
- data.tar.gz: 72c016be4117d12955f448aba07d3f02c2262fb590e8c3b2361aeae9a307aab3d588520e28da8d3e6cb421b9649e751a05ff901fdfe4a6349577f7505730b466
6
+ metadata.gz: 8609ab1d338c91ae68e5681b6ac5588b5546177e35793363d0b1caaef156953a44a8cf5716dbb6b8702c7e2a3ccc4ea4a6e1cbdfa12e53492e1ab918c7c7ba17
7
+ data.tar.gz: 7d917139b63470b12a67e2a3eceaa075845a1510dee2202d067114d3b2ef388bfc8e85fb883b21815f25388c657388707546060055d0a38a6603be02ae499ce7
@@ -28,6 +28,7 @@ gemfile:
28
28
  - gemfiles/rails5_1_5.gemfile
29
29
  - gemfiles/rails5_1_6.gemfile
30
30
  - gemfiles/rails5_2_0.gemfile
31
+ - gemfiles/rails5_2_1.gemfile
31
32
  - gemfiles/rails_edge.gemfile
32
33
 
33
34
  env:
@@ -40,8 +41,6 @@ services:
40
41
 
41
42
  before_install:
42
43
  - docker run -d --name turntable-katsubushi -p 11212:11212 katsubushi/katsubushi:latest -worker-id 1
43
- - gem update --system
44
- - gem install bundler --no-doc
45
44
 
46
45
  before_script:
47
46
  - bundle exec rake $SETUP_TASK
@@ -61,10 +60,12 @@ matrix:
61
60
  gemfile: gemfiles/rails5_0_7.gemfile
62
61
  - rvm: 2.2.10
63
62
  gemfile: gemfiles/rails5_1_6.gemfile
63
+ - rvm: 2.2.10
64
+ gemfile: gemfiles/rails5_2_1.gemfile
64
65
  - rvm: 2.3.7
65
- gemfile: gemfiles/rails5_1_6.gemfile
66
+ gemfile: gemfiles/rails5_2_1.gemfile
66
67
  - rvm: 2.4.4
67
- gemfile: gemfiles/rails5_1_6.gemfile
68
+ gemfile: gemfiles/rails5_2_1.gemfile
68
69
  - rvm: 2.5.1
69
70
  gemfile: gemfiles/rails_edge.gemfile
70
71
  - rvm: ruby-head
@@ -1,3 +1,13 @@
1
+ ## activerecord-turntable 4.4.0 ##
2
+
3
+ ### Major Changes
4
+
5
+ * Support activerecord v5.2.1
6
+
7
+ ### Bugfixes
8
+
9
+ * Fix sql parser error when inserting boolean value with rails version 5.2.0 or later
10
+
1
11
  ## activerecord-turntable 4.3.0 ##
2
12
 
3
13
  ### Bugfixes
data/Gemfile CHANGED
@@ -2,8 +2,8 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rails", "5.2.0"
5
+ gem "rails", "5.2.1"
6
6
 
7
- gem "actionview", "5.2.0"
8
- gem "activerecord", "5.2.0"
9
- gem "activesupport", "5.2.0"
7
+ gem "actionview", "5.2.1"
8
+ gem "activerecord", "5.2.1"
9
+ gem "activesupport", "5.2.1"
data/README.md CHANGED
@@ -27,7 +27,7 @@ MySQL only.
27
27
  Add to Gemfile:
28
28
 
29
29
  ```ruby
30
- gem 'activerecord-turntable', '~> 4.3.0'
30
+ gem 'activerecord-turntable', '~> 4.4.0'
31
31
  ```
32
32
 
33
33
  Run a bundle install:
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
38
38
  spec.add_development_dependency "guard-rspec"
39
39
  spec.add_development_dependency "guard-rubocop"
40
40
  spec.add_development_dependency "httpclient", ">= 0"
41
- spec.add_development_dependency "mysql2", "~> 0.4.4"
41
+ spec.add_development_dependency "mysql2", ">= 0.4.4", "< 0.6.0"
42
42
  spec.add_development_dependency "onkcop"
43
43
  spec.add_development_dependency "pry"
44
44
  spec.add_development_dependency "pry-byebug"
@@ -5,5 +5,6 @@ gem "railties", "5.2.0"
5
5
  gem "activerecord", "5.2.0"
6
6
  gem "activesupport", "5.2.0"
7
7
  gem "actionview", "5.2.0"
8
+ gem "mysql2", "~> 0.5.2"
8
9
 
9
10
  gemspec :path => '../'
@@ -0,0 +1,10 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "rails", "5.2.1"
4
+ gem "railties", "5.2.1"
5
+ gem "activerecord", "5.2.1"
6
+ gem "activesupport", "5.2.1"
7
+ gem "actionview", "5.2.1"
8
+ gem "mysql2", "~> 0.5.2"
9
+
10
+ gemspec :path => '../'
@@ -12,7 +12,7 @@ module ActiveRecord::Turntable
12
12
  end
13
13
 
14
14
  delegate :connected?, :checkout_timeout, :automatic_reconnect, :automatic_reconnect=, :checkout_timeout, :checkout_timeout=, :dead_connection_timeout,
15
- :spec, :connections, :size, :reaper, :table_exists?, :query_cache_enabled, :enable_query_cache!, :schema_cache, :schema_cache=, to: :proxy
15
+ :spec, :connections, :size, :reaper, :table_exists?, :query_cache_enabled, :enable_query_cache!, :disable_query_cache!, :schema_cache, :schema_cache=, to: :proxy
16
16
 
17
17
  %w(columns_hash column_defaults primary_keys).each do |name|
18
18
  define_method(name.to_sym) do
@@ -10,7 +10,7 @@ module SQLTree
10
10
  end
11
11
 
12
12
  class SQLTree::Token
13
- extended_keywords = %w(BINARY LIMIT OFFSET INDEX KEY USE FORCE IGNORE)
13
+ extended_keywords = %w(BINARY LIMIT OFFSET INDEX KEY USE FORCE IGNORE TRUE FALSE)
14
14
  KEYWORDS.concat(extended_keywords)
15
15
 
16
16
  extended_keywords.each do |kwd|
@@ -264,6 +264,34 @@ module SQLTree::Node
264
264
 
265
265
  class Value
266
266
  leaf :escape
267
+
268
+ def to_sql(options = {})
269
+ case value
270
+ when nil; 'NULL'
271
+ when true; 'TRUE'
272
+ when false; 'FALSE'
273
+ when String; quote_str(@value)
274
+ when Numeric; @value.to_s
275
+ when Date; @value.strftime("'%Y-%m-%d'")
276
+ when DateTime, Time; @value.strftime("'%Y-%m-%d %H:%M:%S'")
277
+ else raise "Don't know how te represent this value in SQL!"
278
+ end
279
+ end
280
+
281
+ def self.parse(tokens)
282
+ case tokens.next
283
+ when SQLTree::Token::String, SQLTree::Token::Number
284
+ SQLTree::Node::Expression::Value.new(tokens.current.literal)
285
+ when SQLTree::Token::NULL
286
+ SQLTree::Node::Expression::Value.new(nil)
287
+ when SQLTree::Token::TRUE
288
+ SQLTree::Node::Expression::Value.new(true)
289
+ when SQLTree::Token::FALSE
290
+ SQLTree::Node::Expression::Value.new(false)
291
+ else
292
+ raise SQLTree::Parser::UnexpectedToken.new(tokens.current, :literal)
293
+ end
294
+ end
267
295
  end
268
296
 
269
297
  class EscapedValue < Value
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Turntable
3
- VERSION = "4.3.0".freeze
3
+ VERSION = "4.4.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-turntable
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.0
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gussan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-06-11 00:00:00.000000000 Z
12
+ date: 2018-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -209,16 +209,22 @@ dependencies:
209
209
  name: mysql2
210
210
  requirement: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - "~>"
212
+ - - ">="
213
213
  - !ruby/object:Gem::Version
214
214
  version: 0.4.4
215
+ - - "<"
216
+ - !ruby/object:Gem::Version
217
+ version: 0.6.0
215
218
  type: :development
216
219
  prerelease: false
217
220
  version_requirements: !ruby/object:Gem::Requirement
218
221
  requirements:
219
- - - "~>"
222
+ - - ">="
220
223
  - !ruby/object:Gem::Version
221
224
  version: 0.4.4
225
+ - - "<"
226
+ - !ruby/object:Gem::Version
227
+ version: 0.6.0
222
228
  - !ruby/object:Gem::Dependency
223
229
  name: onkcop
224
230
  requirement: !ruby/object:Gem::Requirement
@@ -539,6 +545,7 @@ files:
539
545
  - gemfiles/rails5_1_5.gemfile
540
546
  - gemfiles/rails5_1_6.gemfile
541
547
  - gemfiles/rails5_2_0.gemfile
548
+ - gemfiles/rails5_2_1.gemfile
542
549
  - gemfiles/rails_edge.gemfile
543
550
  - lib/active_record/turntable.rb
544
551
  - lib/active_record/turntable/active_record_ext.rb