aboutsummaryrefslogtreecommitdiff
path: root/perl/Wallet/Schema.pm
diff options
context:
space:
mode:
authorJon Robertson <jonrober@stanford.edu>2013-01-31 16:27:49 -0800
committerRuss Allbery <rra@stanford.edu>2013-01-31 16:35:01 -0800
commitbf18b39b6afe541e6888d32d6a555643cbe9d22e (patch)
tree9d224736f0a6f6b803a749938e631bd262be0c26 /perl/Wallet/Schema.pm
parenta30984dc9602e5a7efe9556f337eb21dbcec8319 (diff)
Renamed dbh subroutines and variables for clarity
In moving from DBI to DBIx::Class, we at first left the various variables the same. This goes through to update them for the proper names. * Wallet::Admin::schema was created to return the schema object (and similarly for Wallet::Server and Wallet::Report). * Wallet::Admin::dbh was modified to return the actual DBI handle again (and similarly for Wallet::Server and Wallet::Report). * Various places that used $admin->{dbh} were moved to $admin->{schema}. * Various places using $dbh for the schema object were changed to $schema. Change-Id: I00914866e9a8250855a7828474aa9ce0f37b914f Reviewed-on: https://gerrit.stanford.edu/733 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/Wallet/Schema.pm')
-rw-r--r--perl/Wallet/Schema.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perl/Wallet/Schema.pm b/perl/Wallet/Schema.pm
index d36b7ac..cee94f7 100644
--- a/perl/Wallet/Schema.pm
+++ b/perl/Wallet/Schema.pm
@@ -40,11 +40,11 @@ sub connect {
my $user = $Wallet::Config::DB_USER;
my $pass = $Wallet::Config::DB_PASSWORD;
my %attrs = (PrintError => 0, RaiseError => 1);
- my $dbh = eval { $class->SUPER::connect ($dsn, $user, $pass, \%attrs) };
+ my $schema = eval { $class->SUPER::connect ($dsn, $user, $pass, \%attrs) };
if ($@) {
die "cannot connect to database: $@\n";
}
- return $dbh;
+ return $schema;
}
__END__
@@ -62,7 +62,7 @@ Wallet::Schema - Database schema and connector for the wallet system
=head1 SYNOPSIS
use Wallet::Schema;
- my $dbh = Wallet::Schema->connect;
+ my $schema = Wallet::Schema->connect;
=head1 DESCRIPTION