Skip to content

Commit

Permalink
Use the connection.to_s output for connection.inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Durand committed Jun 19, 2014
1 parent 7a04be3 commit 6a23d09
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.0.16

Use shorter to_s output for output on connection.inspect.

1.0.15

Implement less wordy connection to string method so logs don't fill up with long messages on connection errors.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.15
1.0.16
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ def to_s
"#<#{self.class.name}:0x#{object_id.to_s(16)} #{all_connections.size} connections>"
end

def inspect
to_s
end

class DatabaseConnectionError < StandardError
end

Expand Down
1 change: 1 addition & 0 deletions spec/seamless_database_pool_adapter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def columns (table_name, name = nil); end

it "should be able to be converted to a string" do
pool_connection.to_s.should =~ /\A#<ActiveRecord::ConnectionAdapters::SeamlessDatabasePoolAdapter::Abstract:0x[0-9a-f]+ 3 connections>\z/
pool_connection.inspect.should == pool_connection.to_s
end

context "selecting a connection from the pool" do
Expand Down

0 comments on commit 6a23d09

Please sign in to comment.