Lite version of ActiveRecord built using skeleton repo and some tutorial guidance. Created a SQLObject class with #create, #update, ::find, and ::all methods. A particular challenge in this project was writing the Associatable module with belongs_to, has_many, and has_many_through class methods. To solve this I used a Ruby object as the data structure to store the the association settings (class name, foreign key, primary key) and used define_method to dynamically create methods based on associations.
monteverdetico / activerecord_lite Goto Github PK
View Code? Open in Web Editor NEWA mini clone of ActiveRecord