I assumed as much. I thought that perhaps someone was thinking that at some point you could make a Jifty::Record abstract by croaking in table(). Commits may be coming shortly.<br><br><div><span class="gmail_quote">On 7/16/07,
<b class="gmail_sendername">Jesse Vincent</b> <<a href="mailto:jesse@bestpractical.com">jesse@bestpractical.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Jul 16, 2007, at 6:07 PM, Andrew Sterling Hanenkamp wrote:<br><br>> Glurg. Okay, I went to clean up and test everything before<br>> committing this patch and discovered a initialization problem. It's<br>> trying to call $model->table for the plugin models, which calls
<br>> $model->_guess_table_name, but this happens before plugin class<br>> itself is configured, which means that the table name will never be<br>> prefixed, which is undesirable.<br>><br>> I have traced it back into the class loader, which runs this
<br>> snippet while loading the models around line 168, which is run<br>> while generating the model action classes (which happens<br>> automatically upon creation of a Jifty::ClassLoader instance):<br>><br>> local $@;
<br>> eval { $modelclass->table } ;<br>> if(!$@) {<br>><br>> return $self->return_class(<br>> "package $module;\n"<br>> . "use base qw/$base\::Action::Record::$1/;\n"
<br>> . "sub record_class { '$modelclass' };\n"<br>> . "sub autogenerated { 1 };\n"<br>> );<br>> }<br>><br>> If I understand what's going on here, it's checking to see if the
<br>> model provides a valid and non-failing implementation of the table<br>> () method to determine whether or not to actually build the action<br>> classes. A similar check is in place for creating the model event
<br>> class too.<br>><br>> Is this necessary? If so, I can look for another way to short-<br>> circuit the process until the plugins are initialized. If not, what<br>> other check would suffice? I'm not certain as for the purpose of
<br>> this at all, so I'm not sure what to do about it.<br><br>I bet that's just duck-typing. perhaps an ->isa check?<br><br>-j<br><br>_______________________________________________<br>jifty-devel mailing list
<br><a href="mailto:jifty-devel@lists.jifty.org">jifty-devel@lists.jifty.org</a><br><a href="http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel">http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel</a><br>
<br><br></blockquote></div><br>