On May 5, 2007, at 9:00 PM, Christopher H. Laco wrote:

Jason Kohles wrote:
column (it just fills it with a 0 instead), but I'll tackle that next, for now I need to figure out why the values aren't being deflated before
they get inserted...


And that's the other part of the problem...values aren't deflated...only
objects are...

    $obj->update({ money => '$10.00' });

should be

    $obj->update({ money => Data::Currency->new(10.00) });

to trigger deflation...but that end, just do:

    $obj->update({ money => 10.00 });

and be done with it....

Now that it's been pointed out it seems glaringly obvious, unfortunately it means a lot more work, since the real application isn't just setting it directly, it's populating objects from HTML::FormFu. Guess I need to go figure out how to write HTML::FormFu::Inflator::Currency too...

--
Jason Kohles
[EMAIL PROTECTED]
http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire



_______________________________________________
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/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to