Using Rails 2.3.10 If my lib/tasks looks like this

lib/tasks
- a.rake
- b.rake

a.rake looks like this:

namespace :a do
    desc "Task A"
    task(:a=>:environment)do
      msg('I AM TASK A')
    end

    def msg(msg)
      puts "MSG SENT FROM Task A: #{msg}"
    end
end

b.rake looks like this

namespace :b do
    desc "Task B"
    task(:b=>:environment)do
      msg('I AM TASK B')
    end

    def msg(msg)
      puts "MSG SENT FROM Task B: #{msg}"
    end
end

Then when I run task a

rake a RAILS_ENV=sandbox

The output is "MSG SENT FROM Task B: I AM TASK A"

So the msg() helper method defined in a.rake does not get called. Rather that defined in b.rake gets called. (What's more, if I have a c.rake - then it's msg helper method gets called when I run task a.

Is this method namespace clashing known behavior? I would have thought the namespacing would have prevented this.

Thanks

Edit
Report