Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nuclearsandwich
Copy link
Member

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.

@steveklabnik
Copy link
Member

Seems good but the build failed for some reason :(

@nuclearsandwich
Copy link
Member Author

Yeah. Still debugging rake test locally as well (gives a one line error message with no stack trace and rspec spec runs without complaint.

@nuclearsandwich
Copy link
Member Author

So the db:test:prepare task is failing. I'm not sure why yet.

@abhirao
Copy link
Contributor

abhirao commented Apr 19, 2013

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.

@nuclearsandwich
Copy link
Member Author

From http://guides.rubyonrails.org/testing.html

db:test:prepare will fail with an error if db/schema.rb doesn’t exist.

I'd rather Rails's db:test:prepare task not exist.

@nuclearsandwich
Copy link
Member Author

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.
@nuclearsandwich
Copy link
Member Author

🎊 🍸 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?

@PragTob
Copy link
Member

PragTob commented Apr 19, 2013

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 :-) )

@nuclearsandwich
Copy link
Member Author

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.

@steveklabnik
Copy link
Member

I dunno what to do.

@nuclearsandwich
Copy link
Member Author

If folks are ambivalent about it, my feeling is to lean toward convention, which is rake tasks and a mongo.yml.

This was referenced Sep 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants