Active Record Lite
Active Record takes a lot of the grunt work out of making database queries. To understand how the world of Rails' Active Record is translated into SQL, I built my own lite version of it.
Below are some noteworthy facets of this project:
MassObjectis the analogue of ActiveRecord's Base class. It creates a class that includes methods for parsing query results and initializing and setting attributes for model objects.
SQLObjectis the interface between ActiveRecordLite and the SQL database. It searches the database along the user specified parameters as well as creates, updates, and saves new entries into the database.
Searchableextends the SQLObject class method, allowing users to perform Active Record's
wherefeature to perform more specific database queries.
Associatableis the bread and butter of this Active Record "Lite" app. It defines
has_one_throughassociations between models and allows the user to perform the relevant database queries for associated models.