Merge the last bits of indirect callchain optimization
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / UTF8Columns.pm
index 9a54e5b..db571a6 100644 (file)
@@ -3,7 +3,7 @@ use strict;
 use warnings;
 use base qw/DBIx::Class/;
 
-__PACKAGE__->mk_classdata( '_utf8_columns' );
+__PACKAGE__->mk_group_accessors( inherited => '_utf8_columns' );
 
 =head1 NAME
 
@@ -31,8 +31,8 @@ stored and de-serialised to unicode strings on retrieval.
   THE USE OF THIS MODULE (AND ITS COUSIN DBIx::Class::ForceUTF8) IS VERY
   STRONGLY DISCOURAGED, PLEASE READ THE WARNINGS BELOW FOR AN EXPLANATION.
 
-If you want to continue using this module and do not want to recieve
-further warnings set the environmane variable C<DBIC_UTF8COLUMNS_OK>
+If you want to continue using this module and do not want to receive
+further warnings set the environment variable C<DBIC_UTF8COLUMNS_OK>
 to a true value.
 
 =head2 Warning - Module does not function properly on create/insert
@@ -44,7 +44,7 @@ L<get_columns|DBIx::Class::Row/get_columns>. As a result of this problem
 L<create|DBIx::Class::ResultSet/create> sends the original column values
 to the database, while L<update|DBIx::Class::ResultSet/update> sends the
 encoded values. L<DBIx::Class::UTF8Columns> and L<DBIx::Class::ForceUTF8>
-are both affected by ths bug.
+are both affected by this bug.
 
 It is unclear how this bug went undetected for so long (it was
 introduced in March 2006), No attempts to fix it will be made while the
@@ -54,7 +54,7 @@ this module anyway as Unicode is properly supported by all major
 database engines, as explained below.
 
 If you have specific questions about the integrity of your data in light
-of this development - please 
+of this development - please
 L<join us on IRC or the mailing list|DBIx::Class/GETTING HELP/SUPPORT>
 to further discuss your concerns with the team.
 
@@ -94,7 +94,7 @@ sub utf8_columns {
     if (@_) {
         foreach my $col (@_) {
             $self->throw_exception("column $col doesn't exist")
-                unless $self->has_column($col);
+                unless $self->result_source->has_column($col);
         }
         return $self->_utf8_columns({ map { $_ => 1 } @_ });
     } else {
@@ -143,7 +143,7 @@ sub get_columns {
 sub store_column {
     my ( $self, $column, $value ) = @_;
 
-    # the dirtyness comparison must happen on the non-encoded value
+    # the dirtiness comparison must happen on the non-encoded value
     my $copy;
 
     if ( defined $value and $self->_is_utf8_column($column) and utf8::is_utf8($value) ) {
@@ -162,13 +162,16 @@ sub _is_utf8_column {
   return ($_[0]->utf8_columns || {})->{$_[1]};
 }
 
-=head1 AUTHORS
+=head1 FURTHER QUESTIONS?
 
-See L<DBIx::Class/CONTRIBUTORS>.
+Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>.
 
-=head1 LICENSE
+=head1 COPYRIGHT AND LICENSE
 
-You may distribute this code under the same terms as Perl itself.
+This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE>
+by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can
+redistribute it and/or modify it under the same terms as the
+L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>.
 
 =cut