[Catalyst] $c->user->some_relationship always retrives user id from the db

Guillermo Roditi groditi at gmail.com
Tue Feb 19 18:43:51 GMT 2008


> > I just bring this up because the code you just sent would not work
> > when one is using things like DigestColumns or EncodedColumn, which
> > are most commonly seen in User-type objects
>
> Don't those allow you to have a 'password' attribute stored in a
> 'password_hash' column or similar now?
>
> Anything else is going to clash somewhere or other.

EncodedColumn overrides set_column() i was originally wrapping the
accessor, but I couldn't find  way to do that without messing with the
symbol table so, at the advice of claco, I overrode set_column() and
new() to encode the value at set time. I guess I could have created a
new accessor, or an expicit set_$column_from_plaintext() method, but I
never really thought about that. In any case, how would
update({password=> $xyz}) new({password => $xyz}) work? password =>
$xys would encode the value but password_hash => $xyz would keep it
untouched? I don't really know how I feel about creating such a
virtual column. It's doable but it means that columns would have to be
renamed to not conflict with the accessor. You eally should have
brought something like this up before release--there was no shortage
of emails sent to the list with regards to the proposed API and
behavior and you were present in IRC during the design discussions...

Anyone else have thoughts?

--Guillermo Roditi (groditi)



More information about the Catalyst mailing list