Hello Jonathan,<br><br>thanks for pointing out these problems. Can you suggest a better solution or do you suggest that I remove this feature from the public version of Og altogether?<br><br>-g.<br><br><br><br><div><span class="gmail_quote">
On 6/4/07, <b class="gmail_sendername">Jonathan Buch</b> &lt;<a href="mailto:john@oxyliquit.de">john@oxyliquit.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi George,<br><br>sorry for destroying your text keys last time.&nbsp;&nbsp;:P<br><br><br>def load(pk)<br>&nbsp;&nbsp; if (key = ann(:self, :text_key)) &amp;&amp; pk.to_i == 0 &amp;&amp; (pk !~ /\S{22}/)<br><br>I think however that there might be potential problems which could
<br>confuse unknowing users.<br><br>* any pk with more than 22 consecutive non witespace chars + text key<br>&nbsp;&nbsp; (that regex should really be /\A\S{22}$\z/ if at all)<br>* Tag[&#39;1.41&#39;]<br>&nbsp;&nbsp; meaning the to_i is potentionally shadowing some values and will raise
<br>&nbsp;&nbsp; a not meaningful DB error (string not applicapable for integer column)<br>&nbsp;&nbsp; and at seemingly &#39;random&#39; values.<br>* OgKlass[request[&#39;oid&#39;]]<br>&nbsp;&nbsp; meaning a string could be passed from someone who doesn&#39;t know, which
<br>&nbsp;&nbsp; all satisfies that, but still is wrong because the primary key of<br>&nbsp;&nbsp; OgKlass is a text key itself, maybe containing &quot;0 Cool&quot;.<br><br>This is the three ways I think this method could go wrong (besides it
<br>using &#39;unnecessary&#39; annotations).<br><br>But then, this is only theoretically, as this is is a toally undocumented<br>feature which only can be found by RTFS&#39;ing and is solely used in<br>Taggable (and even there undocumented).
<br><br>So I guess this has its point, as it&#39;s only used by a single person<br>who knows what he&#39;s doing.&nbsp;&nbsp;;)<br><br>Jo<br><br>--<br>Using Opera&#39;s revolutionary e-mail client: <a href="http://www.opera.com/mail/">
http://www.opera.com/mail/</a><br>_______________________________________________<br>Nitro-general mailing list<br><a href="mailto:Nitro-general@rubyforge.org">Nitro-general@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/nitro-general">
http://rubyforge.org/mailman/listinfo/nitro-general</a><br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://georgeandstella.com">http://georgeandstella.com</a><br><a href="http://blog.gmosx.com">http://blog.gmosx.com
</a><br><a href="http://cull.gr">http://cull.gr</a><br><a href="http://www.joy.gr">http://www.joy.gr</a><br><a href="http://nitroproject.org">http://nitroproject.org</a>