-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Drive via Rails app #48
Conversation
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 Oaken file was written first and then used to drive out the bin/rails g model
calls!
Oaken::Seeds.preregister ActiveRecord::Base.connection.tables | ||
Oaken::Seeds.load_from "db/seeds/accounts/kaspers_donuts" |
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.
We haven't quite integrated with bin/rails db:seed
yet.
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.
I messed around with this a bit a few days ago. Adding these Oaken::Seeds
calls to a Railtie in the gem code nearly did the trick, but I ran into some circular include
errors when trying to use this for both dev seeds and test data.
Did you have a specific approach in mind for abstracting this setup into the gem itself?
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.
Did you have a specific approach in mind for abstracting this setup into the gem itself?
@blvrd not exactly yet, I still haven't settled on anything concrete. I think load_from
has to change, but I don't know how yet.
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.
Cool, I'll dig into it a bit more this week if I have some time.
Ok, this lets us dogfood and drive the development more through the app modeling. There's still work needed to use the Rails app in tests, which I'm not quite sure what that entails yet. |
I'm starting to dogfood the development with data that's more real. So to that end I've added a
test/dummy
Rails app akin to how Rails::Engine gem's work.This app is a meal ordering site, so there'll both be a backoffice where restaurants can setup a menu items and prices, and then users can order those items.
See
test/dummy/db/seeds/accounts/kaspers_donuts.rb
for the Oaken bit. We wrote this file out first and then generated the models. Runningbin/rails db:seed
works! Though there's still some details to fix around #46 where we presume the data is cached.