fresh_connection 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/fresh_connection.gemspec +1 -1
- data/lib/fresh_connection/slave_connection.rb +8 -0
- data/lib/fresh_connection.rb +1 -1
- data/rails/initializers/active_record_base.rb +9 -0
- metadata +23 -40
data/History.txt
CHANGED
data/fresh_connection.gemspec
CHANGED
@@ -32,6 +32,14 @@ module FreshConnection
|
|
32
32
|
(@ignore_models || []).include?(model_name)
|
33
33
|
end
|
34
34
|
|
35
|
+
def ignore_configure_connection?
|
36
|
+
!!@ignore_configure_connection
|
37
|
+
end
|
38
|
+
|
39
|
+
def ignore_configure_connection=(flag)
|
40
|
+
@ignore_configure_connection = flag
|
41
|
+
end
|
42
|
+
|
35
43
|
private
|
36
44
|
|
37
45
|
def slave_connection
|
data/lib/fresh_connection.rb
CHANGED
@@ -34,6 +34,15 @@ module ActiveRecord
|
|
34
34
|
@connection = master_con
|
35
35
|
end
|
36
36
|
end
|
37
|
+
|
38
|
+
class MysqlAdapter < AbstractAdapter
|
39
|
+
private
|
40
|
+
|
41
|
+
def configure_connection_with_ignore
|
42
|
+
configure_connection_without_ignore unless FreshConnection::SlaveConnection.ignore_configure_connection?
|
43
|
+
end
|
44
|
+
alias_method_chain :configure_connection, :ignore
|
45
|
+
end
|
37
46
|
end
|
38
47
|
|
39
48
|
class Base
|
metadata
CHANGED
@@ -1,35 +1,27 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: fresh_connection
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Tsukasa OISHI
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2010-10-16 00:00:00 Z
|
12
|
+
date: 2010-10-16 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
|
-
|
22
|
-
email:
|
14
|
+
description: FreshConnection supports of connect with Mysql slave servers via Load
|
15
|
+
Balancers.
|
16
|
+
email:
|
23
17
|
- tsukasa.oishi@gmail.com
|
24
18
|
executables: []
|
25
|
-
|
26
19
|
extensions: []
|
27
|
-
|
28
|
-
extra_rdoc_files:
|
20
|
+
extra_rdoc_files:
|
29
21
|
- History.txt
|
30
22
|
- Manifest.txt
|
31
23
|
- README.rdoc
|
32
|
-
files:
|
24
|
+
files:
|
33
25
|
- Rakefile
|
34
26
|
- fresh_connection.gemspec
|
35
27
|
- lib/fresh_connection.rb
|
@@ -41,37 +33,28 @@ files:
|
|
41
33
|
- README.rdoc
|
42
34
|
homepage: https://github.com/tsukasaoishi/fresh_connection
|
43
35
|
licenses: []
|
44
|
-
|
45
36
|
post_install_message:
|
46
|
-
rdoc_options:
|
37
|
+
rdoc_options:
|
47
38
|
- --main
|
48
39
|
- README.rdoc
|
49
|
-
require_paths:
|
40
|
+
require_paths:
|
50
41
|
- lib
|
51
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
43
|
none: false
|
53
|
-
requirements:
|
54
|
-
- -
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
|
57
|
-
|
58
|
-
- 0
|
59
|
-
version: "0"
|
60
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
49
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
segments:
|
67
|
-
- 0
|
68
|
-
version: "0"
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
69
54
|
requirements: []
|
70
|
-
|
71
55
|
rubyforge_project: fresh_connection
|
72
|
-
rubygems_version: 1.
|
56
|
+
rubygems_version: 1.8.24
|
73
57
|
signing_key:
|
74
58
|
specification_version: 3
|
75
59
|
summary: FreshConnection supports of connect with Mysql slave servers via Load Balancers.
|
76
60
|
test_files: []
|
77
|
-
|