replidog 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/replidog/model.rb +1 -1
- data/lib/replidog/version.rb +1 -1
- data/spec/replidog/model_spec.rb +21 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46db50a29d4f79490ab194e8fd6ca7a93f35ef18
|
4
|
+
data.tar.gz: 0d07db46f99b14deef971a9f432f94c7df120973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16e48177f5d08a6b3e10ee85786b68316ccb6e9ab95eb156246dbee8f3f3f6d1e8d442e9b1f7981c59d0f34ec929783905277139ad32cbd2a8bf1e94ad5542b2
|
7
|
+
data.tar.gz: 657b50e89491b0472cf0e28078dc760064e351fd03037198a00e2e4dd5cfe565f2ddec76a47c6795ba3ee211affe77119414623761f0a6a4dbc3bd2f6a7fdfa9
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Based on https://github.com/r7kamura/replicat
|
|
9
9
|
* Multiple master/slave
|
10
10
|
* Auto switching between master/slave
|
11
11
|
* Supports connection management and query cache
|
12
|
-
* Supports Rails 3.2, 4.0, 4,1, 4.2, 5.0
|
12
|
+
* Supports Rails 3.2, 4.0, 4,1, 4.2, 5.0, 5.1
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
data/lib/replidog/model.rb
CHANGED
data/lib/replidog/version.rb
CHANGED
data/spec/replidog/model_spec.rb
CHANGED
@@ -304,4 +304,25 @@ describe Replidog::Model do
|
|
304
304
|
end
|
305
305
|
end
|
306
306
|
end
|
307
|
+
|
308
|
+
describe "#with_lock" do
|
309
|
+
context "with using master name" do
|
310
|
+
it "executes SQL query on master connection" do
|
311
|
+
Recipe.using(:master).create(title: "test")
|
312
|
+
Recipe.using(:master).first.with_lock do
|
313
|
+
Recipe.first.update_attributes!(title: "test_update")
|
314
|
+
end
|
315
|
+
expect(Recipe.first).to eq Recipe.first
|
316
|
+
end
|
317
|
+
end
|
318
|
+
|
319
|
+
context "with using slave name" do
|
320
|
+
it "executes SQL query on slave connection" do
|
321
|
+
Recipe.using(:slave1).create(title: "test")
|
322
|
+
Recipe.using(:slave2).create(title: "test")
|
323
|
+
Recipe.using(:slave3).create(title: "test")
|
324
|
+
expect{ Recipe.first.with_lock }.to raise_error(ActiveRecord::RecordNotFound)
|
325
|
+
end
|
326
|
+
end
|
327
|
+
end
|
307
328
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: replidog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Ejima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|