At the moment when you create a new engine, its rakefile has such lines:

APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

It loads only selected db tasks under the global rake namespace and makes
all the engine's rake tasks available under the app: namespace.

The other approach would be to bring all the tasks of the engine to the
global rake namespace by doing something like this:

load File.expand_path("../spec/dummy/Rakefile", __FILE__)

Could anyone explain me what is the reasoning behind this task selectivity
and app: namespacing?
It does seem clearer to me to see only really required for the development
of the gem tasks in the global namespace, but is it the only reason?
The problem is that some gems expect to see such tasks as db:test:prepare
and db:abort_if_pending_migrations in the global namespace and fail to work
properly when the tasks are in the app: namespace.
So is it a fail on the side of these gems?

I published this question on the Ruby on Rails: Core group as well, but
somehow my post just didn't appear here, so I'm trying to post it here.
Sorry if in the end the post appears at both the groups.

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouprubyonrails-talk @
postedAug 23, '13 at 10:58a
activeAug 23, '13 at 10:58a

1 user in discussion

Yuriy Trofimenko: 1 post



site design / logo © 2021 Grokbase