From: Mintywalker Date: Sat, 12 Apr 2014 17:13:27 +0000 (+0100) Subject: Add 3rd example of col info in ResultSource->add_column X-Git-Tag: v0.082800~113 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0f3ce807cd6cd0a2bd3cf1073a1ce7683ab0432f;p=dbsrgits%2FDBIx-Class.git Add 3rd example of col info in ResultSource->add_column Rather than just say "it's a hashref", provide a simple example of what that hashref might look like. --- diff --git a/lib/DBIx/Class/ResultSource.pm b/lib/DBIx/Class/ResultSource.pm index 4f04be8..7e0ae81 100644 --- a/lib/DBIx/Class/ResultSource.pm +++ b/lib/DBIx/Class/ResultSource.pm @@ -143,6 +143,11 @@ sub new { $source->add_columns('col1' => \%col1_info, 'col2' => \%col2_info, ...); + $source->add_columns( + 'col1' => { data_type => 'integer', is_nullable => 1, ... }, + 'col2' => { data_type => 'text', is_auto_increment => 1, ... }, + ); + Adds columns to the result source. If supplied colname => hashref pairs, uses the hashref as the L for that column. Repeated calls of this method will add more columns, not replace them.