[Catalyst-commits] r11231 -
Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Mon Aug 24 10:24:03 GMT 2009
Author: caelum
Date: 2009-08-24 10:24:03 +0000 (Mon, 24 Aug 2009)
New Revision: 11231
Modified:
Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm
Log:
use BUILD's $args instead of %$self
Modified: Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm
===================================================================
--- Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm 2009-08-24 09:06:16 UTC (rev 11230)
+++ Catalyst-Model-DBIC-Schema/trunk/lib/Catalyst/Model/DBIC/Schema.pm 2009-08-24 10:24:03 UTC (rev 11231)
@@ -469,7 +469,7 @@
);
sub BUILD {
- my $self = shift;
+ my ($self, $args) = @_;
my $class = $self->_original_class_name;
my $schema_class = $self->schema_class;
@@ -505,7 +505,7 @@
$self->schema($self->composed_schema->clone);
- $self->_pass_options_to_schema;
+ $self->_pass_options_to_schema($args);
$self->schema->storage_type($self->storage_type)
if $self->storage_type;
@@ -621,13 +621,16 @@
}
sub _pass_options_to_schema {
- my $self = shift;
+ my ($self, $args) = @_;
- my @attributes = map $_->name, $self->meta->get_all_attributes;
+ my @attributes = map {
+ $_->init_arg || ()
+ } $self->meta->get_all_attributes;
+
my %attributes;
@attributes{@attributes} = ();
- for my $opt (keys %$self) {
+ for my $opt (keys %$args) {
if (not exists $attributes{$opt}) {
next unless $self->schema->can($opt);
$self->schema->$opt($self->{$opt});
More information about the Catalyst-commits
mailing list