Skip to content

Instantly share code, notes, and snippets.

View jwrobes's full-sized avatar

Jonathan Wrobel jwrobes

View GitHub Profile

##Single Table Inheritance

A.K.A. "The One Table to Rule them All" A.K.A. STI

Single table inheritance comes from trying to figure out a way to convert the magic inheritance from object oriented programming into the relational database system.

So to understand it you need to understand the basics of inheritance in object oriented programming.

You have a class that can have some attributes. In Ruby you would initialize the class. And and give it some basic attributes and maybe some class methods.

@jwrobes
jwrobes / 0_reuse_code.js
Created March 11, 2014 16:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jwrobes
jwrobes / jquery_example.html
Last active August 29, 2015 13:56 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery_example.js"></script>
@jwrobes
jwrobes / 0.2.1-boggle_class_from_methods.rb
Last active January 2, 2016 21:49 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
=begin
To create a class for BoggleBoard I need to initialize the class
and set an instance variable for the board that is passed inside
and it should test that what is passed in is an array with has four columns
and four rows and raise an argument error if it does not
I could create a separate method just to test that
and run that test method in the initialize method of the BoggleBoard class
I can create a #create_word method by passing in the coordinates as an argument
and have those coordinates call on the instance variable holding the boggle board