@@ -1688,11 +1688,11 @@ def cmd_db_status(*args)
1688
1688
1689
1689
if framework . db . connection_established?
1690
1690
cdb = ""
1691
- ::ActiveRecord ::Base . connection_pool . with_connection { |conn |
1692
- if conn . respond_to? :current_database
1691
+ ::ActiveRecord ::Base . connection_pool . with_connection do |conn |
1692
+ if conn . respond_to? ( :current_database )
1693
1693
cdb = conn . current_database
1694
1694
end
1695
- }
1695
+ end
1696
1696
print_status ( "#{ framework . db . driver } connected to #{ cdb } " )
1697
1697
else
1698
1698
print_status ( "#{ framework . db . driver } selected, no connection" )
@@ -1706,16 +1706,16 @@ def cmd_db_connect_help
1706
1706
1707
1707
def cmd_db_connect ( *args )
1708
1708
return if not db_check_driver
1709
- if framework . db . connection_established?
1709
+ if args [ 0 ] != '-h' && framework . db . connection_established?
1710
1710
cdb = ""
1711
- ::ActiveRecord ::Base . connection_pool . with_connection { |conn |
1712
- if conn . respond_to? :current_database
1711
+ ::ActiveRecord ::Base . connection_pool . with_connection do |conn |
1712
+ if conn . respond_to? ( :current_database )
1713
1713
cdb = conn . current_database
1714
1714
end
1715
- }
1716
- status = "#{ framework . db . driver } already connected to #{ cdb } . "
1717
- status += "Run db_disconnect first if you wish to connect to a different database."
1718
- return print_status ( status )
1715
+ end
1716
+ print_status ( "#{ framework . db . driver } already connected to #{ cdb } . " +
1717
+ "Run db_disconnect first if you wish to connect to a different database." )
1718
+ return
1719
1719
end
1720
1720
if ( args [ 0 ] == "-y" )
1721
1721
if ( args [ 1 ] and not ::File . exists? ::File . expand_path ( args [ 1 ] ) )
0 commit comments