[Dbix-class] Bug: update_or_create() and auto-inflate/deflate

Matt S Trout dbix-class at trout.me.uk
Wed May 10 17:26:29 CEST 2006


Daniel Westermann-Clark wrote:
> On 2006-05-10 13:23:44 +0200, Bernhard Graf wrote:
>> It seems that one of the dates to compare is a scalar while the
>> other is a DateTime object (DateTime overloads comparison operators,
>> so compare operation end in DateTime->compare()).
>>
>> To work correctly, update_or_create() should compare both dates in
>> deflated state, right?
> 
> The problem is that update_or_create bypasses deflation.  For now at
> least, it expects you to give it "column data", e.g. a datetime string
> which can be used in your inflation code.
> 
> This is consistent with calling $row->update with a hashref: both
> methods use $row->set_columns.  (And as of a few minutes ago on the
> -current branch, update_or_create simply calls $row->update.)
> 
> My understanding is that the inflation code is planned for revision to
> avoid some of this confusion, but there are more pressing issues.

Actually, I'm pretty sure update() is overriden by InflateColumn to 
handle this, so so long as you call that it should all be fine.



More information about the Dbix-class mailing list