<p>Suppose <code>foo</code> is an inflated timestamp column and <code>$row->foo</code> is set to a true DateTime (representing a date, say, 2016-06-23T16:42:34). In the present code, these two code snippets:</p>
<pre><code>$row->set_inflated_column(foo => undef);
say 'The value is: '.$row->get_column('foo');
say 'The value is: '.$row->foo;
$row->set_inflated_columns({ foo => undef, });
say 'The value is: '.$row->get_column('foo');
say 'The value is: '.$row->foo;
</code></pre>
<p>would do different things. The first prints</p>
<pre><code>The value is:
The value is:
</code></pre>
<p>the second prints</p>
<pre><code>The value is:
The value is: 2016-06-23T16:42:34
</code></pre>
<p>Because <code>update</code> uses <code>set_inflated_columns</code>, the same behavior is visible there.</p>
<p>This change makes <code>set_inflated_columns</code> call <code>set_inflated_column</code> when the column is inflated and new value is <code>undef</code> (which <code>set_inflated_column</code> handles correctly), which causes the two functions to behave identically in this case, which seems like the correct behavior.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/dbsrgits/dbix-class/pull/106'>https://github.com/dbsrgits/dbix-class/pull/106</a></p>
<h4>Commit Summary</h4>
<ul>
<li>Treat undef like blessed objects for the purpose of looking for special handling</li>
</ul>
<h4>File Changes</h4>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/dbsrgits/dbix-class/pull/106/files#diff-0">lib/DBIx/Class/Row.pm</a>
(2)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/dbsrgits/dbix-class/pull/106.patch'>https://github.com/dbsrgits/dbix-class/pull/106.patch</a></li>
<li><a href='https://github.com/dbsrgits/dbix-class/pull/106.diff'>https://github.com/dbsrgits/dbix-class/pull/106.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/dbix-class/pull/106">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AASeAkGuUNceX_AZ-fgOTEBcbNpLDkNRks5qQEXPgaJpZM4I_izM">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AASeAla6PYcxIXiJCiR-6L9sKFbNhSoeks5qQEXPgaJpZM4I_izM.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/dbsrgits/dbix-class/pull/106"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>