[Nitro] George: annotation :text_key

George Moschovitis george.moschovitis at gmail.com
Tue Jun 5 03:49:26 EDT 2007

Hello Jonathan,

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


On 6/4/07, Jonathan Buch <john at oxyliquit.de> wrote:
> Hi George,
> sorry for destroying your text keys last time.  :P
> def load(pk)
>    if (key = ann(:self, :text_key)) && pk.to_i == 0 && (pk !~ /\S{22}/)
> I think however that there might be potential problems which could
> confuse unknowing users.
> * any pk with more than 22 consecutive non witespace chars + text key
>    (that regex should really be /\A\S{22}$\z/ if at all)
> * Tag['1.41']
>    meaning the to_i is potentionally shadowing some values and will raise
>    a not meaningful DB error (string not applicapable for integer column)
>    and at seemingly 'random' values.
> * OgKlass[request['oid']]
>    meaning a string could be passed from someone who doesn't know, which
>    all satisfies that, but still is wrong because the primary key of
>    OgKlass is a text key itself, maybe containing "0 Cool".
> This is the three ways I think this method could go wrong (besides it
> using 'unnecessary' annotations).
> But then, this is only theoretically, as this is is a toally undocumented
> feature which only can be found by RTFS'ing and is solely used in
> Taggable (and even there undocumented).
> So I guess this has its point, as it's only used by a single person
> who knows what he's doing.  ;)
> Jo
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070605/d4633e7c/attachment.html 

More information about the Nitro-general mailing list