db-charmer 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +8 -0
- data/VERSION +1 -1
- data/db-charmer.gemspec +1 -1
- data/lib/db_charmer/active_record_extensions.rb +5 -5
- metadata +2 -2
data/CHANGES
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
1.5.1 -> 1.5.3:
|
2
|
+
|
3
|
+
Few changes:
|
4
|
+
* Colorized connection names in the logs for development mode
|
5
|
+
* We do not log connection names when connection does not exist
|
6
|
+
|
7
|
+
----------------------------------------------------------------------------------------
|
8
|
+
|
1
9
|
1.5.0 -> 1.5.1:
|
2
10
|
|
3
11
|
In this version we've added support for connection names logging in Rails queries log.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.3
|
data/db-charmer.gemspec
CHANGED
@@ -3,12 +3,12 @@ module DbCharmer
|
|
3
3
|
module ClassMethods
|
4
4
|
|
5
5
|
def establish_real_connection_if_exists(name, should_exist = false)
|
6
|
-
config = configurations[RAILS_ENV][name.to_s]
|
7
|
-
|
8
|
-
|
6
|
+
unless config = configurations[RAILS_ENV][name.to_s]
|
7
|
+
if should_exist
|
8
|
+
raise ArgumentError, "Invalid connection name (does not exist in database.yml): #{RAILS_ENV}/#{name}"
|
9
|
+
end
|
10
|
+
return # No need to establish connection - they do not want us to
|
9
11
|
end
|
10
|
-
# If there is no config, use default one
|
11
|
-
config ||= configurations[RAILS_ENV].clone
|
12
12
|
# Pass connection name with config
|
13
13
|
config[:connection_name] = name.to_s
|
14
14
|
establish_connection(config)
|