To understand Ruby on Rails better and how it interfaces with the underlying SQL database, I wrote my own subset of ActiveRecord. It features associations such as belongs_to, has_many, has_one_through. It also features mass assignment.