[Nitro] arrgghhhh

Arne Brasseur arne at arnebrasseur.net
Sun Jul 22 06:25:20 EDT 2007


Something like

if defined?(Og) && Og.respond_to?(:manager) && Og.manager

?

(ab)

Robert Mela schreef:
> I remember the old Lint quizzes ( "What's wrong with this C program?") 
> in Dr. Dobbs in the '90s.
>
> So, in that spirit: What's wrong with this code?
>
>    if defined?(Og) and Og.respond_to?(:manager)
>      # THINK: don't allways force this.
>      require "raw/model/enchant"
>      for m in Og.manager.models
>        m.send(:include, Enchant)
>      end
>    end
>
> It's in application.rb from a fresh darcs get I did today.
>
> I think I've reported & patched this one before -- or maybe it was a 
> similar bug elsewhere...
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general


-- 
Arne Brasseur
http://www.arnebrasseur.net
arne at arnebrasseur.net



More information about the Nitro-general mailing list