Hello!

In a table schema of mine I have:

__PACKAGE__->inflate_column('published', {
    inflate     => sub { time_db2obj(shift) },
    deflate     => sub { time_obj2db(shift) },
});

I noticed that the deflate method is NOT called when I use update() on a
resultset an pass data like this:

$c->model('Dbs')->resultset('MyTable')->update(
    field1     => 'val',
    field2     => 'val'
    published  => $datetime_object
);

At least, it seems like thid because "cannot compare a DateTime to a
scalar" is thrown. The deflate method IS however regularly called if I
do like this:

$c->model('Dbs')->resultset('MyTable')->published($datetime_object);
$c->update();

That is, if I use named method ( such as published() ) it works,
otherwise it doesn't.

Is this an expected behaviour?

By the way, create() works well and calls the deflator.

        Thanks, Michele.

-- 
Michele Beltrame
http://www.varlogarthas.net/
ICQ# 76660101
Informativa privacy: http://www.italpro.net/em.html

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/

Reply via email to