Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

Healthy Relationships

Skill Level: Intermediate
Time Limit: 30 minutes

Active Record is a object relational mapper that connects classes to relational database tables. These classes are commonly called models. Models can also be connected to other models by defining associations.

Under the surface, Active Record provides a level of abstraction that helps you reduce the amount of SQL you would have to write for simple and sometimes complex statements.

Instructions

Fill out the migrations and models in the associations.rb file in such a way that the resulting methods produce the expected output. I've also included a few helper gems that should help with visualizing these models and their relationships.

Example:

class Person < ActiveRecord::Base  
  has_many :orders  
end

Person.create(name: Jill, age: 45)  
Person.orders << Order.create(description: "Pizza Boxes")  
p Person.orders.first => #<Order: id: 1, description: '...'>

Resources

Table Print Gem
Awesome Print Gem
Active Record Basics Association Basics

About

An introduction to Active Record

Resources

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

You can’t perform that action at this time.