Skip to content

bendelonlee/ActiveRecordExercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Description

Active Record Exercises is a series of exercises designed to help people learning ActiveRecord, the ORM for Rails. Users can attempt to complete exercises by running their ActiveRecord queries against our mock database. If stuck they can peek, though they won't be able to 'complete' the exercises for 24 hours. Encouraging users to come back a day later is intended to help them memorize and master ActiveRecord's particular syntax.

Ruby version

ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-darwin18]

Contribution

Is there an essential feature of ActiveRecord we've missed? Are you an ActiveRecord buff who'd like to concoct a challenging query?

Submit these and other pull requests and issues here:

https://github.com/bendelonlee/ActiveRecordExercises

Database set up

Databases are Postgresql. The multiverse gem is used so that the main app is in a separate database from the one the user runs queries on.

To set up app databases run:

rails db:{create,migrate,seed,test:prepare}

test:prepare is necessary because of the way rspec and multiverse interact.

You'll also need to set up the 'school' database, the one that the user runs queries on:

$ DB=school rails db:{create,migrate,seed,test:prepare}

Because the some exercises are id specific, you can't run $ DB=school rails db:seed by itself. Instead run $ DB=school rails db:{drop,create,migrate,seed,test:prepare}

for more information on the multiverse gem: https://github.com/ankane/multiverse

  • Running the test suite

$ bundle exec rspec

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published