-
Notifications
You must be signed in to change notification settings - Fork 104
Namespace config #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Namespace config #53
Conversation
jarthod
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this MR, I like the idea, a couple comments
| class TestCase < Minitest::Test #:nodoc: | ||
|
|
||
| def setup | ||
| Mongoid::Migrator.migrations_path = ["db/migrate"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
| assert_equal ["db/mongoid"], Mongoid::Migrator.migrations_path | ||
| Mongoid::Migrator.migrations_path += ["engines/my_engine/db/migrate"] | ||
| assert_equal ["db/mongoid", "engines/my_engine/db/migrate"], Mongoid::Migrator.migrations_path | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really testing the namespacing of tasks ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't but practically speaking if one really wants to de-conflict with ActiveRecord they should be modifying both the namespace and the path. Coz if the actual migration files of AR and Mongo live in the same path the rake tasks will still fail. Hence I tested both in the same test case.
Speaking it out loud, this caveat should be mentioned in the README file too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem with that, what I mean is that the namespacing itself is not tested, if you remove all the changes in database.rake this spec still pass isn't it? I'm not sure if it's easy to do so but I think we should verify the list of rake tasks generated, that their name is correct.
|
Thanks so much! This would close #59 |
|
@jgandt-wp Indeed, if you like this approach too, feel free to continue this MR (it's mostly missing specs AFAICS). |
f4509bc to
3bb749d
Compare
|
@heitor-s indeed nobody finished it yet, feel free to continue and submit it (with specs 🙏) |
Make rake task namespace to configurable so conflict with
ActiveRecordrake tasks can be avoided