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

Matt S Trout dbix-class at trout.me.uk
Sat Feb 23 18:21:18 GMT 2008


On Tue, Feb 19, 2008 at 01:43:51PM -0500, Guillermo Roditi wrote:
> > > 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...

Well, I think it would be nice to be able to support both.

And yes, my fault for not thinking about this before release - it didn't
really occur to me until now when you pointed out how not doing it could
break stuff ... :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list