Re: add_to_ question

[prev] [thread] [next] [Date index for 2004/09/10]

From: mendlefarg
Subject: Re: add_to_ question
Date: 01:38 on 10 Sep 2004
Duh. There's also an easier way out it seems.

sub Music::Artist::add {
	my ($self, $data) = @_;
	
	if (UNIVERSAL::isa('Music::CD') {
		$data->{'artistid'} = $self->id;
		$data->update unless $data->autoupdate;
		return $data;
	} else {
		return $self->add_to_cds($data);
	};
}

I still think it would be interesting if to add_to_ stuff could Do The Right THing when it received a child object instead of a HASH. Yeah, I know. "Patches Welcome". :-)

add_to_ question
Christopher Laco 13:55 on 09 Sep 2004

Re: add_to_ question
mendlefarg 01:38 on 10 Sep 2004

Re: add_to_ question
Tony Bowden 06:50 on 10 Sep 2004

Re: add_to_ question
Christopher Laco 11:33 on 10 Sep 2004

Re: add_to_ question
Tony Bowden 12:51 on 10 Sep 2004

Re: add_to_ question
Christopher Laco 13:28 on 10 Sep 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52