Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removing useless ternary

  • Loading branch information...
commit a4458f5d21da65c4291aa339ac91c332867752f7 1 parent a70248c
Aaron Patterson tenderlove authored
2  activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
View
@@ -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
2  activerecord/test/cases/pooled_connections_test.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.