Skip to content

paircolumbus/HealthyRelationships

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages