I wanted to write a project using ActiveRecord and that morphed into wanting the database rake tasks as well. This project is where I stopped and posted to use as a starting point for such projects.
I don't make any claims that this is correct, good, the best, or
anything like that. The Rakefile
mostly came from
this response on
StackOverflow.
The fd.rb
was cobbled together from various suggestions on web
sites.
This is using PostgreSQL but any database that ActiveRecord supports should work.
- Clone the repository
- Install Postgres
- Create a user in Postgres
bundle install
rake db:create
rake db:migrate
./fd.rb
psql -c 'select * from files;' files_development
id | path | created_at | updated_at
----+-----------+----------------------------+----------------------------
1 | Hobgoblin | 2022-03-30 18:16:36.509568 | 2022-03-30 18:16:36.509568
(1 row)