some trivial fixes for "TEST_POD=1 make test" failures
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Row.pm
index 8a4bfc9..4c66600 100644 (file)
@@ -323,17 +323,24 @@ sub is_changed {
 
 =head2 register_column($column, $column_info)
 
-  Registers a column on the class and creates an accessor for it
+  Registers a column on the class. If the column_info has an 'accessor' key,
+  creates an accessor named after the value if defined; if there is no such
+  key, creates an accessor with the same name as the column
 
 =cut
 
 sub register_column {
   my ($class, $col, $info) = @_;
-  $class->mk_group_accessors('column' => $col);
+  my $acc = $col;
+  if (exists $info->{accessor}) {
+    return unless defined $info->{accessor};
+    $acc = [ $info->{accessor}, $col ];
+  }
+  $class->mk_group_accessors('column' => $acc);
 }
 
 
-=item throw_exception
+=head2 throw_exception
 
 See Schema's throw_exception.