[Dbix-class] Re: A timestamp field is null when a record is
created
Peter Rabbitson
rabbit+dbic at rabbit.us
Thu Nov 1 08:25:12 GMT 2012
On Wed, Oct 31, 2012 at 05:17:24PM +0300, Eugene Yarmash wrote:
> >On Wed, Oct 31, 2012 at 04:44:54PM +0300, Eugene Yarmash wrote:
> >>/ "discard_changes" is more general approach. For example it can be
> >/>/ used with "prefetch".
> >/
> ><blink>. If anything discard_changes and prefetch are rather mutually
> >exclusive. Can you clarify what do you mean?
> >
> $object = $rs->create($data)
> ->discard_changes({ prefetch => ['key1', key2' ] });
Ah right, ok. As a kludge for us not yet having implemented postfecth()
functionality. While still horrific and nasty, you are right - it is
currently the way to do that.
Btw in the example above you meant ['rel1', 'rel2'], prefetch does not
operate on keys.
Cheers
More information about the DBIx-Class
mailing list