Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::upgrade(3pm) [debian man page]

Jifty::Upgrade(3pm)					User Contributed Perl Documentation				       Jifty::Upgrade(3pm)

NAME
Jifty::Upgrade - Superclass for schema/data upgrades to Jifty applications SYNOPSIS
package MyApp::Upgrade; use base qw/ Jifty::Upgrade /; use Jifty::Upgrade qw/ since rename /; since '0.7.4' => sub { # Rename a column rename table => 'cthulus', name => 'description', to => 'mind_numbingly_horrible_word_picture'; }; since '0.6.1' => sub { my @sizes = ('Huge', 'Gigantic', 'Monstrous', 'Really Big'); my @appearances = ('Horrible', 'Disgusting', 'Frightening', 'Evil'); # populate new columns with some random stuff my $cthulus = MyApp::Model::CthuluCollection->new; while (my $cthulu = $cthulus->next) { $cthulu->set_size($sizes[ int(rand(@sizes)) ]); $cthulu->set_appearance($appearances[ int(rand(@appearances)) ]); } }; DESCRIPTION
"Jifty::Upgrade" is an abstract base class to use to customize schema and data upgrades that happen. since VERSION SUB "since" is meant to be called by subclasses of "Jifty::Upgrade". Calling it signifies that SUB should be run when upgrading to version VERSION, after tables and columns are added, but before tables and columns are removed. If multiple subroutines are given for the same version, they are run in order that they were set up. versions Returns the list of versions that have been registered; this is called by the Jifty::Script::Schema tool to determine what to do while upgrading. upgrade_to VERSION Runs the subroutine that has been registered for the given version; if no subroutine was registered, returns a no-op subroutine. rename table => CLASS, [column => COLUMN,] to => NAME Used in upgrade subroutines, this executes the necessary SQL to rename the table, or column in the table, to a new name. SEE ALSO
Jifty::Manual::Upgrading perl v5.14.2 2010-12-08 Jifty::Upgrade(3pm)

Check Out this Related Man Page

Jifty::Action::Record::Execute(3pm)			User Contributed Perl Documentation		       Jifty::Action::Record::Execute(3pm)

NAME
Jifty::Action::Record::Execute - Simple abstract based for record actions SYNOPSIS
use strict; use warnings; package MyApp::Action::StartEncabulator; use base qw/ MyApp::Action::ExecuteEncabulator /; use Jifty::Param::Schema; use Jifty::Action schema { param cardinal_grammeter_mode => type is 'text', valid_values are qw/ magneto-reluctance capacitive-duractance sinusoidal-depleneration /, is mandatory, ; }; sub take_action { my $self = shift; my $mode = $self->argument_value('cardinal_grammeter_mode'); $self->record->start($mode); $self->result->success('Deluxe Encabulator has started!'); } # Later in your templates: my $encabulator = MyApp::Model::Encabulator->new; $encabulator->load($id); my $startup = Jifty->web->new_action( class => 'StartEncabulator', record => $encabulator, ); Jifty->web->form->start; Jifty->web->out( $startup->form_field('cardinal_grammeter_mode') ); Jifty->web->form->submit( label => _('Start'), submit => $startup, ); Jifty->web->form->end; DESCRIPTION
This action class is a good generic basis for creating custom action classes. It expects a record object to be associated and is (in this way) very similar to Jifty::Action::Record::Delete. You can use Jifty::Param::Schema to add additional form fields to the action and such. METHODS
arguments This is customized so that it expects the "record" argument of all Jifty::Action::Record actions, but also allows for overrides using Jifty::Param::Schema. take_action This overrides the definition in Jifty::Action::Record so that it does absolutely nothing rather than complain. You will probably want to implement your own version that actually does something. SEE ALSO
Jifty::Action, Jifty::Action::Record, Jifty::Record LICENSE
Jifty is Copyright 2005-2010 Best Practical Solutions, LLC. Jifty is distributed under the same terms as Perl itself. perl v5.14.2 2010-12-10 Jifty::Action::Record::Execute(3pm)
Man Page