[Dbix-class] Inflation (DBIx::Class::InflateColumn) Troubles...
Jason Kohles
email at jasonkohles.com
Sun May 6 02:20:08 GMT 2007
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 at jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing." -- Voltaire
More information about the Dbix-class
mailing list