active_record_playground
active_record_playground copied to clipboard
This is a simple template to help you play with Active Record, when you don't need or don't want to create a full Rails app.
Active Record Playground
This is a simple template to help you play with Active Record, when you don't need or don't want to create a full Rails app.
It gives you a...
- Gemfile
- A place to put you seeds
- A place to put your database configuration
- A place to define the database schema
How to use it
- Define a database name on
db/database_name.rb - Define the database schema on
db/schema.rb - Create some seeds if you need them on
db/seed.rb - Add examples on the
examples/dir, but require first theexamples/config
How to run the examples
-
Install the dependencies with
bundle install. -
Database setup - run the command:
ruby db/setup.rb
- Run the examples with
ruby examples/<file name>. For example:
ruby example/00_example.rb
- Change the seeds on
db/seeds.rband re-runruby db/setup.rbto test different scenarios.