Active Record in a Nutshell

Sample Gemfile
Sample Environment.rb
Sample connection_adapter.rb
Sample db_registry.rb
Sample database.yml
Project Layout
  1. Create a migration file: In this example we have a migration file that creates a students table. Migration files can be created manually or optionally with the “rake db:create_migration NAME=?” syntax. Migration files are placed the db/migrate folder. Special note that care should taken when naming migration files as well as which actions are performed in the migration file. In this case we are creating a students table, so the migration is named with the convention prefix_create_students. Please see Active Record migration documentation for further details.
Create table migration
Creating or altering a schema with db:migrate
DB modifications
Student and School classes




Entertaining tangents

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Product Metrics: The Trickle-Up Method

Feeder Finance: AutoStaking Data Update

How industries are solving challenges using Ansible.

My first Python project: how I converted a disorganized text file into a neat CSV file

How to make URL cute ?

Mental Preparation to Let Your Project Go

A light feather, let go off in the pond

Meet BambooDeFi Team -Update 1-

Skill stacking

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jeff Simon

Jeff Simon

Entertaining tangents

More from Medium

For the Record

How to use Scaffolding in Ruby on Rails.

Understanding Rails Serializers

Ruby: Active Record Overview