db-charmer 1.5.2 → 1.5.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.
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.2
1
+ 1.5.3
data/db-charmer.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{db-charmer}
8
- s.version = "1.5.2"
8
+ s.version = "1.5.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexey Kovyrin"]
@@ -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
- if should_exist && !config
8
- raise ArgumentError, "Invalid connection name (does not exist in database.yml): #{RAILS_ENV}/#{name}"
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)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 2
9
- version: 1.5.2
8
+ - 3
9
+ version: 1.5.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alexey Kovyrin