Permalink
Browse files

removing useless ternary

  • Loading branch information...
1 parent 1ef9b98 commit 49e406efb793c71d4f523635e3dafd1f6a59022c @tenderlove tenderlove committed Aug 19, 2010
View
2 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -322,7 +322,7 @@ def retrieve_connection(klass) #:nodoc:
# already been opened.
def connected?(klass)
conn = retrieve_connection_pool(klass)
- conn ? conn.connected? : false
+ conn && conn.connected?
end
# Remove the connection for this class. This will close the active
View
2 activerecord/test/cases/pooled_connections_test.rb
@@ -89,7 +89,7 @@ def test_not_connected_defined_connection_returns_false
def test_undefined_connection_returns_false
old_handler = ActiveRecord::Base.connection_handler
ActiveRecord::Base.connection_handler = ActiveRecord::ConnectionAdapters::ConnectionHandler.new
- assert_equal false, ActiveRecord::Base.connected?
+ assert ! ActiveRecord::Base.connected?
ensure
ActiveRecord::Base.connection_handler = old_handler
end

0 comments on commit 49e406e

Please sign in to comment.