From: Matt S Trout Date: Thu, 20 May 2010 18:09:52 +0000 (+0000) Subject: fix find() since that was also broken in r8754 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ecb7c05bf1c075bab0749879547aede9712991b8;p=dbsrgits%2FDBIx-Class-Historic.git fix find() since that was also broken in r8754 --- diff --git a/Changes b/Changes index 17eea21..e6c97fb 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for DBIx::Class + - Fix find() to use result_class set on object - Fix result_class setter behaviour to not mistakenly stuff attrs. - Don't try and ensure_class_loaded an object. This doesn't work. - Add a warning to load_namespaces if a class in ResultSet/ diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 4e06ed6..ce86650 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -538,8 +538,8 @@ sub find { : $self->_add_alias($input_query, $alias); } - # Run the query - my $rs = $self->search ($query, $attrs); + # Run the query, passing the result_class since it should propagate for find + my $rs = $self->search ($query, {result_class => $self->result_class, %$attrs}); if (keys %{$rs->_resolved_attrs->{collapse}}) { my $row = $rs->next; carp "Query returned more than one row" if $rs->next;