Commit b1c83246 authored by Brandon Walts's avatar Brandon Walts
Browse files

go_figure_dbc blesses all DBConnections as hive DBConnections

parent aa94abae
......@@ -326,19 +326,18 @@ sub go_figure_dbc {
my ($foo, $schema_type) = @_;
# if(UNIVERSAL::isa($foo, 'Bio::EnsEMBL::DBSQL::DBConnection')) { # already a DBConnection, return it:
if ( ref($foo) =~ /DBConnection$/ ) { # already a DBConnection, return it:
return $foo;
if ( ref($foo) =~ /DBConnection$/ ) { # already a DBConnection, hive-ify it and return
return bless $foo, 'Bio::EnsEMBL::Hive::DBSQL::DBConnection';
# } elsif(UNIVERSAL::can($foo, 'dbc') and UNIVERSAL::isa($foo->dbc, 'Bio::EnsEMBL::DBSQL::DBConnection')) {
} elsif(UNIVERSAL::can($foo, 'dbc') and ref($foo->dbc) =~ /DBConnection$/) {
return $foo->dbc;
return bless $foo->dbc, 'Bio::EnsEMBL::Hive::DBSQL::DBConnection';
# } elsif(UNIVERSAL::can($foo, 'db') and UNIVERSAL::can($foo->db, 'dbc') and UNIVERSAL::isa($foo->db->dbc, 'Bio::EnsEMBL::DBSQL::DBConnection')) { # another data adaptor or Runnable:
} elsif(UNIVERSAL::can($foo, 'db') and UNIVERSAL::can($foo->db, 'dbc') and ref($foo->db->dbc) =~ /DBConnection$/) { # another data adaptor or Runnable:
return $foo->db->dbc;
return bless $foo->db->dbc, 'Bio::EnsEMBL::Hive::DBSQL::DBConnection';
} elsif(my $db_conn = (ref($foo) eq 'HASH') ? $foo : url2dbconn_hash( $foo ) ) { # either a hash or a URL that translates into a hash
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment