All,

I encountered an interesting bug in some production code today and learned 
something new about Rails and rake task namespacing.

Rake task namespaces don't work the way Ruby namespaces do, that is, if you 
define two methods with the same name in two different rake tasks (not the 
tasks themselves) you will get a name collision.  Depending on the order 
the rake tasks are loaded the method in one of your rake tasks will be 
overwritten while the other one will apparently work normally.

This Stack Overflow question describes the issue and how to avoid it:

http://stackoverflow.com/questions/175655/how-to-find-where-a-method-is-defined-at-runtime

Since I've been doing this a while and wasn't aware of this issue I thought 
I'd share.  Be careful out there!

Cheers,

Chris

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to