activerecord-simple-slave 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +3 -3
- data/lib/activerecord/simple_slave.rb +4 -1
- data/lib/activerecord/simple_slave/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c7fb8702f25a57870aad780e17a508b64d6fe5ff8a99267f10ab4217501811e1
|
|
4
|
+
data.tar.gz: 6c01a3bb3b46627cf8b960108b70811ae0ae90250e2f304661fb4f9181b839ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ea08c2da89eaab786bde137e09406b44395168ba29d3034ff11da089b0f63e296d0fd42aa874755641330a03857d9304b6ca265c4a60d954d886dc5e9b3e201
|
|
7
|
+
data.tar.gz: 14bbe1a2fcc70b851d2077dece03359015a0d66b8231d5b009e76af35eb660de7be484958bdbb0ba48582afa0d3127bb0bb2b2d3b33592f8d35410bc89d45956
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -30,18 +30,18 @@ development:
|
|
|
30
30
|
port: 3306
|
|
31
31
|
username: root
|
|
32
32
|
password: root
|
|
33
|
-
simple_slave_url: mysql2://slave.localhost:3306
|
|
33
|
+
simple_slave_url: mysql2://slave.localhost:3306 # port is optional
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
You can also use the environment variable `DATABASE_SIMPLE_SLAVE` to declare
|
|
37
37
|
your slave server address.
|
|
38
38
|
```shell
|
|
39
39
|
# EXPORT ENV VAR GLOBALLY
|
|
40
|
-
export DATABASE_SIMPLE_SLAVE=slave.localhost:3306
|
|
40
|
+
export DATABASE_SIMPLE_SLAVE=mysql2://slave.localhost:3306
|
|
41
41
|
bundle exec rails server
|
|
42
42
|
|
|
43
43
|
# OR PER COMMAND :)
|
|
44
|
-
DATABASE_SIMPLE_SLAVE=slave.localhost:3306 bundle exec rails server
|
|
44
|
+
DATABASE_SIMPLE_SLAVE=mysql2://slave.localhost:3306 bundle exec rails server
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Extend your model with ActiveRecord::SimpleSlave module, then use :
|
|
@@ -9,7 +9,10 @@ module ActiveRecord
|
|
|
9
9
|
def simple_slave_configuration
|
|
10
10
|
@simple_slave_configuration ||= connection_config.dup.tap do |config|
|
|
11
11
|
if simple_slave_url.nil?
|
|
12
|
-
|
|
12
|
+
if defined?(::Rails)
|
|
13
|
+
::Rails.logger.warn \
|
|
14
|
+
'simple slave disabled (no configuration provided)'
|
|
15
|
+
end
|
|
13
16
|
next
|
|
14
17
|
end
|
|
15
18
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activerecord-simple-slave
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julien D.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -94,8 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '0'
|
|
96
96
|
requirements: []
|
|
97
|
-
|
|
98
|
-
rubygems_version: 2.7.6
|
|
97
|
+
rubygems_version: 3.0.3
|
|
99
98
|
signing_key:
|
|
100
99
|
specification_version: 4
|
|
101
100
|
summary: ActiveRecord SimpleSlave gem
|