MojoMojo

 view release on metacpan or  search on metacpan

lib/MojoMojo/Controller/Admin.pm  view on Meta::CPAN

        return 1;
    }
}

=head2 update_user ( *private*)

Update user based on user listing.

=cut

sub update_user : Local {
    my ( $self, $c, $user ) = @_;
    $user = $c->model("DBIC::Person")->find($user) || return;

    #  if ($action eq 'active') {
    $user->active( ($user->active == 1) ? 0 : 1 );

    #  }
    $user->update;
    $c->stash->{user} = $user;
}

lib/MojoMojo/Schema/Result/Page.pm  view on Meta::CPAN

Create a new content version for this page.

%args is each column of L<MojoMojo::Schema::Result::Content>.

=cut

# update_content: this whole method may need work to deal with workflow.
# maybe it can't even be called if the site uses workflow...
# may need fixing for better conflict handling, too. maybe use a transaction?

sub update_content {
    my ( $self, %args ) = @_;

    my $content_version = (
          $self->content
        ? $self->content->max_version()
        : undef
    );
    my %content_data =
      map { $_ => $args{$_} }
      $self->result_source->related_source('content')->columns;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.169 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )