db-charmer 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +7 -1
- data/VERSION +1 -1
- data/db-charmer.gemspec +1 -1
- data/lib/db_charmer/active_record_extensions.rb +10 -0
- data/lib/db_charmer/db_magic.rb +2 -1
- data/lib/db_charmer/multi_db_proxy.rb +1 -1
- metadata +2 -2
data/CHANGES
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
+
1.6.5 (2010-04-05):
|
2
|
+
|
3
|
+
Bugfix release: Fixed :connection vs :slave in db_magic behaviour. Model.on_master should
|
4
|
+
run queries on the master, not on AR's default connection.
|
5
|
+
|
6
|
+
----------------------------------------------------------------------------------------
|
1
7
|
1.6.4 (2010-04-05):
|
2
8
|
|
3
|
-
Default behaviour changed: DbCharmer.connections_should_exist is true in all environments
|
9
|
+
Default behaviour changed: DbCharmer.connections_should_exist is true in all environments
|
4
10
|
by default. Old default behaviour was too misleading for many developers.
|
5
11
|
|
6
12
|
----------------------------------------------------------------------------------------
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.5
|
data/db-charmer.gemspec
CHANGED
@@ -36,6 +36,16 @@ module DbCharmer
|
|
36
36
|
@@db_charmer_connection_proxies[self.name]
|
37
37
|
end
|
38
38
|
|
39
|
+
#-----------------------------------------------------------------------------
|
40
|
+
@@db_charmer_default_connection = nil
|
41
|
+
def db_charmer_default_connection=(conn)
|
42
|
+
@@db_charmer_default_connection = conn
|
43
|
+
end
|
44
|
+
|
45
|
+
def db_charmer_default_connection
|
46
|
+
@@db_charmer_default_connection
|
47
|
+
end
|
48
|
+
|
39
49
|
#-----------------------------------------------------------------------------
|
40
50
|
@@db_charmer_slaves = {}
|
41
51
|
def db_charmer_slaves=(slaves)
|
data/lib/db_charmer/db_magic.rb
CHANGED
@@ -9,7 +9,7 @@ module DbCharmer
|
|
9
9
|
should_exist = opt[:should_exist] || DbCharmer.connections_should_exist?
|
10
10
|
|
11
11
|
# Main connection management
|
12
|
-
setup_connection_magic(opt[:connection], should_exist)
|
12
|
+
setup_connection_magic(opt[:connection], should_exist)
|
13
13
|
|
14
14
|
# Set up slaves pool
|
15
15
|
opt[:slaves] ||= []
|
@@ -59,6 +59,7 @@ module DbCharmer
|
|
59
59
|
|
60
60
|
def setup_connection_magic(conn, should_exist = false)
|
61
61
|
switch_connection_to(conn, should_exist)
|
62
|
+
self.db_charmer_default_connection = conn
|
62
63
|
end
|
63
64
|
|
64
65
|
def setup_slaves_magic(slaves, should_exist = false)
|