activerecord-turntable 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Rakefile +1 -0
- data/activerecord-turntable.gemspec +6 -5
- data/lib/active_record/turntable/mixer.rb +1 -1
- data/lib/active_record/turntable/sql_tree_patch.rb +4 -0
- data/lib/active_record/turntable/version.rb +1 -1
- data/spec/active_record/turntable/active_record_ext/persistence_spec.rb +14 -0
- data/spec/migrations/001_create_users.rb +1 -0
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8069297634d4cb87e81b6f4e06332ce1d5876183
|
4
|
+
data.tar.gz: bd7470ff554b46af40af99e904add373e3109d46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ecad4f8c75a561cedb0fca64e859a045b0518b252cc69c63f4ef31e0312570728e2e0adbe99844de53b2a6f93aaebc2918a7680dc3dfc2b29f252a1238fc4c2
|
7
|
+
data.tar.gz: 1b4d0ab20b846f1abd96fb5f4fd1924829150da9666783f8ecec67f5bf67e521fa422efa31cc5223cffc76f0e96ba152e033190a43f6ec46bd1a0ae725996c63
|
data/CHANGELOG.md
CHANGED
data/Rakefile
CHANGED
@@ -21,12 +21,13 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
22
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
23
23
|
spec.require_paths = ["lib"]
|
24
|
+
spec.required_ruby_version = '>= 1.9.3'
|
24
25
|
|
25
|
-
spec.
|
26
|
-
spec.
|
27
|
-
spec.
|
28
|
-
spec.
|
29
|
-
spec.
|
26
|
+
spec.add_runtime_dependency "activerecord", ">= 4.0.0", "< 5.0"
|
27
|
+
spec.add_runtime_dependency "activesupport", ">= 4.0.0", "< 5.0"
|
28
|
+
spec.add_runtime_dependency "sql_tree", "= 0.2.0"
|
29
|
+
spec.add_runtime_dependency "bsearch", "~> 1.5"
|
30
|
+
spec.add_runtime_dependency "httpclient", ">= 0"
|
30
31
|
|
31
32
|
# optional dependencies
|
32
33
|
spec.add_development_dependency "activerecord-import"
|
@@ -214,7 +214,7 @@ module ActiveRecord::Turntable
|
|
214
214
|
tree.values = [[SQLTree::Node::Expression::Variable.new("\\0")]]
|
215
215
|
sql = tree.to_sql
|
216
216
|
value_sql = vs.map do |val|
|
217
|
-
"(#{val.map { |v| @proxy.connection.quote(v.value)}.join(', ')})"
|
217
|
+
"(#{val.map { |v| "#{v.escape}#{@proxy.connection.quote(v.value)}" }.join(', ')})"
|
218
218
|
end.join(', ')
|
219
219
|
sql.gsub!('("\0")') { value_sql }
|
220
220
|
shards_with_query[@proxy.cluster.shard_for(k)] = sql
|
@@ -35,6 +35,20 @@ describe ActiveRecord::Turntable::ActiveRecordExt::Persistence do
|
|
35
35
|
Card.create!(:name => 'foobar')
|
36
36
|
}
|
37
37
|
|
38
|
+
context "When creating record" do
|
39
|
+
context "with blob column" do
|
40
|
+
let(:blob_value) { "\123\123\123" }
|
41
|
+
let(:user) {
|
42
|
+
u = User.new(:nickname => 'x', :blob => blob_value )
|
43
|
+
u.id = 1
|
44
|
+
u.save
|
45
|
+
u
|
46
|
+
}
|
47
|
+
subject { user }
|
48
|
+
its(:blob) { is_expected.to eq(user.reload.blob) }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
38
52
|
context "When the model is sharded by surrogate key" do
|
39
53
|
it "should not changed from normal operation when updating" do
|
40
54
|
user.nickname = "fizzbuzz"
|
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: 2.0.
|
4
|
+
version: 2.0.4
|
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: 2014-11-
|
12
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -18,6 +18,9 @@ dependencies:
|
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 4.0.0
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '5.0'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -25,6 +28,9 @@ dependencies:
|
|
25
28
|
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
30
|
version: 4.0.0
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: activesupport
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -32,6 +38,9 @@ dependencies:
|
|
32
38
|
- - ">="
|
33
39
|
- !ruby/object:Gem::Version
|
34
40
|
version: 4.0.0
|
41
|
+
- - "<"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '5.0'
|
35
44
|
type: :runtime
|
36
45
|
prerelease: false
|
37
46
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -39,6 +48,9 @@ dependencies:
|
|
39
48
|
- - ">="
|
40
49
|
- !ruby/object:Gem::Version
|
41
50
|
version: 4.0.0
|
51
|
+
- - "<"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '5.0'
|
42
54
|
- !ruby/object:Gem::Dependency
|
43
55
|
name: sql_tree
|
44
56
|
requirement: !ruby/object:Gem::Requirement
|
@@ -429,7 +441,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
429
441
|
requirements:
|
430
442
|
- - ">="
|
431
443
|
- !ruby/object:Gem::Version
|
432
|
-
version:
|
444
|
+
version: 1.9.3
|
433
445
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
434
446
|
requirements:
|
435
447
|
- - ">="
|