<br><div class="gmail_quote">On Thu, Aug 26, 2010 at 9:11 AM, Peter Rabbitson <span dir="ltr">&lt;<a href="mailto:rabbit%2Bdbic@rabbit.us">rabbit+dbic@rabbit.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">Pavel A. Karoukin wrote:<br>
&gt; On Thu, Aug 26, 2010 at 3:33 AM, Peter Rabbitson &lt;<a href="mailto:rabbit%2Bdbic@rabbit.us">rabbit+dbic@rabbit.us</a><br>
</div><div class="im">&gt; &lt;mailto:<a href="mailto:rabbit%252Bdbic@rabbit.us">rabbit%2Bdbic@rabbit.us</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Pavel A. Karoukin wrote:<br>
&gt;     &gt; Hello,<br>
&gt;     &gt;<br>
&gt;     &gt; I am trying to make something work nice, but it doesn&#39;t want to =)<br>
&gt;     &gt; Probably, it&#39;s just by design, or I am missing something.<br>
&gt;     &gt;<br>
&gt;     &gt; Question: is it possible to make it work with $user-&gt;data-&gt;{test} = 1;<br>
&gt;     &gt; notation? I.e. I do not want to create new methods in results<br>
&gt;     class, not<br>
&gt;     &gt; want to extract hash from field first and then save it?<br>
&gt;<br>
&gt;     Absolutely impossible, since the whole idea of InflateColumn is:<br>
&gt;     *) A plain scalar value supplied to new/update is assumed to be an<br>
&gt;     already-deflated value to be placed directly in the database<br>
&gt;     *) Any type of reference (blessed or not) is a candidate for deflation<br>
&gt;     and passed on to the deflator<br>
&gt;<br>
&gt;     However you may find that FilterColumn does exactly what you want to<br>
&gt;     do.<br>
&gt;<br>
&gt;<br>
&gt; Peter,<br>
&gt;<br>
&gt; Thank you for pointing to FilterColumn. I&#39;ve tried it with almost same<br>
&gt; result tho.. Probably I am doing something wrong?<br>
&gt;<br>
</div><div class="im">&gt; And now in my controller code trying this:<br>
&gt;<br>
&gt;   $c-&gt;user-&gt;data-&gt;{test}; # return &quot;yes&quot; as stored in DB in JSON format<br>
&gt;   $c-&gt;user-&gt;data-&gt;{test} = &quot;no&quot;; # now this contain &quot;no&quot;, but not stored<br>
&gt; in DB yet<br>
&gt;   $c-&gt;user-&gt;update(); # I thought it should pass $c-&gt;user-&gt;date to<br>
&gt; __data_to_storage(), but it never do this. Why?<br>
&gt;<br>
<br>
</div>I misunderstood your initial question, sorry. For what you are doing both<br>
IC and FC will work. However the data column stores a *reference* to a<br>
hash. By doing hash-&gt;{key} = val you are not changing the reference, so<br>
as far as DBIC is concerned the value of the column did not change.<br>
What you need to do is manually invoke[1] or replace the entire hashref<br>
with another hashref.<br>
<br>
[1] <a href="http://search.cpan.org/~frew/DBIx-Class-0.08123/lib/DBIx/Class/Row.pm#make_column_dirty" target="_blank">http://search.cpan.org/~frew/DBIx-Class-0.08123/lib/DBIx/Class/Row.pm#make_column_dirty</a><br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br></div><div>Thank you Peter! That&#39;s something I had in mind but I didn&#39;t know about possibility column being dirty! I will try to rework it somehow to make call to make_column_dirty() automatically inside of &quot;something&quot;  =)</div>

<div><br></div><div>Regards,</div><div>Pavel</div></div>