sub search {
my $self = shift;
my $attrs = {};
- if (@_ > 1 && ref $_[$#_] eq 'HASH') {
+ if (@_ > 1 && ref $_[-1] eq 'HASH') {
$attrs = { %{ pop(@_) } };
}
my $where = (@_ ? ((@_ == 1) ? ((ref $_[0] eq "HASH") ? { %{+shift} } : shift)
}
sub new_related {
- return shift->search_related(shift)->new_result(@_);
+ $_[0]->throw_exception("Calling new_related() as a class method is not supported")
+ unless length ref $_[0];
+
+ shift->next::method(@_);
}
=head1 FURTHER QUESTIONS?