Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 619 Bytes

README.md

File metadata and controls

17 lines (13 loc) · 619 Bytes

Active Record Lite

This project contains the basics of Active Record functionality. Metaprogramming is used in order to redefine common AR features:

  • attr_accessible and attr_accessor
  • Initial table setup
  • Common SQL queries, such as:
    • Find by id
    • Find all
    • Update record
    • Create new record
    • Save
  • BelongsTo and HasMany associations
  • HasOneThrough

SQL queries are written using Heredocs, leveraging string interpolation to handle a variable number of inputs into the queries. Methods and instance variables are setup through the use of ::send and ::define_method.