-
Notifications
You must be signed in to change notification settings - Fork 102
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
Removes ActiveRecord from all the things. #146
base: master
Are you sure you want to change the base?
Removes ActiveRecord from all the things. #146
Conversation
Seems good but the build failed for some reason :( |
Yeah. Still debugging |
So the |
I took a quick look. It seems we're currently not getting the db:test:prepare task from mongo_mapper. It sees that active record has already defined it so it does not override it. See line 48 on https://github.com/jnunemaker/mongomapper/blob/master/lib/mongo_mapper/railtie/database.rake So I think the correct fix would be to add a config by using rails generate mongo_mapper:config. Then you could also clean up the mongo_mapper initializer. |
From http://guides.rubyonrails.org/testing.html
I'd rather Rails's |
Oh, you know, we define a no op db test prepare in https://github.com/hacketyhack/hackety-hack.com/blob/master/lib/tasks/cucumber.rake#L53-L55 I wonder if we're stepping on Mongo's task's toes. |
I don't like this, I think it might be worth 💀ing Mongo's `db:test:prepare` task and replacing it with a no op one. The logic in the config/mongo.yml file mirrors the logic in the Ruby initializer, but no one should rightfully expect logic to exist in the yml file.
🎊 🍸 Travis says this works. But I hate myself for doing it. @steveklabnik what do you think? Rip out MongoMapper's rake task and go back to a Ruby initializer or use magical erb'd yaml? |
I'd prefer a different solution and don't have a very firm grasp of the problem atm. But can't we just make our tasks NOT depend on take db:test:prepare so we won't need it? Shouldn't it work then or what am I missing (just chiming in from the side :-) ) |
If we decide not to use the rake tasks, I would opt to create shell scripts rather than new rake tasks. The existing tasks come directly from rspec and cucumber and I believe just run the whole suite. I don't know if the rake tasks themselves pass logic for rerunning tests. The spec_helper.rb and support/env.rb files set up database cleaner but don't explicitly add any seed data. |
I dunno what to do. |
If folks are ambivalent about it, my feeling is to lean toward convention, which is rake tasks and a mongo.yml. |
Near as I can tell, we aren't using ActiveRecord. This clears the database.yml, sqlite and pg gems, and related railtie from the application. Which will prevent new (or stale) contributors from going on wild goose chases.