Use and declare UTF-8 encoding in POD.
[dbsrgits/DBIx-Class-InflateColumn-IP.git] / lib / DBIx / Class / InflateColumn / IP.pm
index ba4a3d5..e1e4c62 100644 (file)
@@ -2,13 +2,16 @@ package DBIx::Class::InflateColumn::IP;
 
 use warnings;
 use strict;
+use 5.008001;
 
-our $VERSION = '0.02001';
+our $VERSION = '0.02002';
 
 use base qw/DBIx::Class/;
 __PACKAGE__->mk_classdata(ip_format => 'addr');
 __PACKAGE__->mk_classdata(ip_class  => 'NetAddr::IP');
 
+=encoding utf-8
+
 =head1 NAME
 
 DBIx::Class::InflateColumn::IP - Auto-create NetAddr::IP objects from columns.
@@ -22,7 +25,7 @@ appropriate format.
     __PACKAGE__->load_components(qw/InflateColumn::IP Core/);
     __PACKAGE__->add_columns(
         ip_address => {
-            data_type => 'integer',
+            data_type => 'bigint',
             is_nullable => 0,
             is_ip => 1,
             ip_format => 'numeric',
@@ -48,8 +51,9 @@ Then you can treat the specified column as a NetAddr::IP object.
 
 DBIx::Class::InflateColumn::IP supports a limited amount of
 auto-detection of the format based on the column type. If the type
-begins with C<int>, it's assumed to be numeric, while C<inet> and
-C<cidr> (as used by e.g. PostgreSQL) are assumed to be C<cidr> format.
+begins with C<int> or C<bigint>, it's assumed to be numeric, while
+C<inet> and C<cidr> (as used by e.g. PostgreSQL) are assumed to be
+C<cidr> format.
 
 =head1 METHODS
 
@@ -109,7 +113,7 @@ sub register_column {
 }
 
 my @format_map = (
-  { type => qr/^int/i,            format => 'numeric' },
+  { type => qr/^(?:big)?int/i, format => 'numeric' },
   { type => qr{^(?:inet|cidr)$}i, format => 'cidr' },
 );
 
@@ -123,7 +127,7 @@ sub _default_format {
 
 =head1 AUTHOR
 
-Dagfinn Ilmari Mannsåker, C<< <ilmari at ilmari.org> >>
+Dagfinn Ilmari Mannsåker, C<< <ilmari at ilmari.org> >>
 
 =head1 BUGS
 
@@ -167,7 +171,7 @@ L<DBIx::Class>, L<NetAddr::IP>
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2007 Dagfinn Ilmari Mannsåker, all rights reserved.
+Copyright 2007 Dagfinn Ilmari Mannsåker, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.