[Nitro] strange syntax in og/entity.rb

Michael Fellinger manveru at weez.co.jp
Thu Apr 20 06:00:53 EDT 2006


IMHO you are absolutly right, it should better be:

%{#{field_name} #{options.delete("#{name}_op".to_sym) || '='} 
#{ogmanager.store.quote(value)}}

and %|| is a string, according to irb at least

On Thursday 20 April 2006 18:37, Stephan Walter wrote:
> Hi,
>
> while digging around in the Og code, I found this in og/entity.rb, line
> 598, private method "finder":
>
> %|#{field_name} #{options.delete("#{name}_op".to_sym) || '='}
> #{ogmanager.store.quote(value)}|
>
> I couldn't find anything in the ruby docs, but I would guess that the
> %|...| will evaluate the string it contains. Is that correct? If yes, I
> see a problem that the string itself contains pipes.
>
> -Stephan
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general



More information about the Nitro-general mailing list