[jifty-devel] overriding UpdateABC .....
mraptor
mraptor at gmail.com
Mon Mar 12 15:12:39 EDT 2007
I have module something like this :
package My::Action::UpdateClient;
use base qw/Jifty::Action::Record::Update My::Action Jifty::Action
My::Params/;
our ($model) = __PACKAGE__ =~ m!Action::Update(.+)$!;
use Jifty::Param::Schema;
#__PACKAGE__->compose($model);
sub record_class { "My::Model::$model" };
sub take_action {
my $self = shift;
$self->SUPER::take_action(@_);
Jifty->web->_redirect('/edit?table=' . (lc $model) . '&id=' .
$self->record->id ) unless $self->result->failure;
return 1;
}
1;
Now because as you see the same module can handle any Model i.e. if
I just rename it from to My::Action::UpdateClient to My::Action::Edit
and then try to reuse it like this :
package VTC::Action::UpdateSomethingElse;
use base qw/VTC::Action::Edit/;
1;
it should be able to handle SomethingElse model, but instead I get the
following error :
Can't call method "argument_names" on an undefined value ....
Any idea why ? and how to resolve it w/o duplicating the same thing..
--
Gee I don't have signature
More information about the jifty-devel
mailing list