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

Daniel Westermann-Clark daniel at acceleration.net
Wed May 10 17:20:10 CEST 2006


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.

-- 
Daniel Westermann-Clark



More information about the Dbix-class mailing list