<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 12:04 PM, Peter Rabbitson <span dir="ltr">&lt;<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote>
The problem in its core (and this has always been the case) is that:<br>
  My::App::Schema::Result::Foo-&gt;<u></u>result_source_instance<br>
    !=<br>
  My::App::Schema-&gt;source(&#39;Foo&#39;)<br>
    !=<br>
  $my_app_schema_instance-&gt;<u></u>source(&#39;Foo&#39;)<br>
<br>
The change in 4006691d207 makes things consistently work on the &quot;current instance level&quot;, whereas before it was not entirely clear where the ResultSourceProxy call will actually land.<br>
<br>
Does this answer your question? Is there something I missed when implementing this part?</blockquote><div><br></div><div>That answers my question -- I don&#39;t think it makes sense to call add_column on a row object, which is what our code was doing.   I don&#39;t know why they (meaning our developer) used this approach instead of just adding additional attribute&#39;s the the result class -- or perhaps creating a subclass with the extra attributes.</div><div><br></div><div>Is that the suggested approach now?  If you have a result class for, say,  &quot;Employee&quot; and you wanted to add meta data (meaning associated attributes that are not stored in the database) for only a subset of Employees that are &quot;retired&quot; is this still the way to go?</div><div><br></div><div>That is something like:</div><div><br></div></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div>package Employee;</div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote">use base &#39;DBIx::Class::Core&#39;;</div><div class="gmail_quote"><div class="gmail_extra"><div class="gmail_quote">__PACKAGE__-&gt;table( &#39;employee&#39; );</div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_extra"><div class="gmail_quote">__PACKAGE__add_columns( ... );</div><div class="gmail_quote">...</div><div class="gmail_quote">1;</div></div></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_extra"><div class="gmail_quote"></div></div></div><div class="gmail_quote"><br></div></div></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>package RetiredEmployee;</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div>use Moose;</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div>extends &#39;Employee&#39;;</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div>__PACKAGE__-&gt;table( &#39;employee&#39; );</div><div>__PACKAGE__-&gt;source_name( &#39;RetiredEmployee&#39; );<br></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div>has current_age =&gt; ( ... );  # for lack of a better example.</div></div></div><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div><div class="gmail_extra"><div class="gmail_quote"><div>1;</div></div></div></blockquote><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div><br></div><div><br></div><div><br></div></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>
</div></div>