Home
10:41 <@mst> marcus: 
    $obj->result_source
        ->resultset
        ->search($obj->ident_condition)
        ->update({ id => $new_id })

From the #dbix-class channel on irc.perl.org

Tags:

Hashing passwords on user creation.

  • Jan. 4th, 2007 at 9:53 AM
If you use Catalyst auth with hashed passwords, here's how to create the digest in your DBIx::Class user class automatically.

sub store_column {
my ($self,$col,$val)= @_;
$val=Digest::SHA::sha1_hex($val) if ($col eq 'password');
return $self->next::method($col,$val);
}

Tags:

I held a lightening talk on monday called 'DBIx::Class from 1.000 feet' at the Extreme Programmers meetup in Oslo. The audience was mostly Java programmers, so I didn't go too much into detail, but I thought it was a nice oportunity to show them that Perl isn't dead. :)

Here is the slides if anyone's interested.

Tags:

DBIx::Class Syntax Example.

  • Apr. 6th, 2006 at 11:52 PM
22:28 <@mst> my ($high_price) = $item->search_related('bids', undef, { select
             => [ { max => 'price' } ], as => [ 'price' ], group_by => 'id'
             })->cursor->next;


Pretty neat, eh? :)

Tags:

Advertisement

Latest Month

June 2009
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930    

Syndicate

RSS Atom
Powered by LiveJournal.com
Designed by Tiffany Chow