Skip to content

FredPetris/active-record-basics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ActiveRecord basics boilerplate

This is a minimalist implementation of ActiveRecord with one Restaurant model to live-code a demo for @LeWagon students, part of Karr examples

  • clone the repo
  • run rake db:create to create your db
  • run your migrations with rake db:migrate

Now you can play with the Restaurant model:

$ irb
irb> load "config/application.rb"
irb> restaurant = Restaurant.new(name: "La Tour d'Argent", address: "15 Quai de la Tournelle, 75005 Paris")
irb> restaurant.persisted?
     # => false
irb> restaurant.id
     # => nil
irb> restaurant.save
irb> restaurant.id
     # => 1

About

ActiveRecord boilerplate for demo @lewagon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%