Skip to content

samblyon/rails_lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails Lite (& ActiveRecord Lite)

Hand-rolled implementation of the basic functionality of Ruby on Rails and Active Record, to improve my understanding of how these tools work under the hood.

Rails functionality built:

  • Singleton Router with REGEX based route generation
  • ApplicationController (as ControllerBase)
  • Rendering of erb template views
  • Exposes params, session, Flash and Flash.now
  • CSRF protection with form authenticity token helper
  • Basic middleware (StaticAssets & ShowExceptions)

Active Record functionality built:

  • ActiveRecord::Base model superclass (as SQLObject)
    • find, all, create, update, destroy
    • chainable where and where_lazy
  • ActiveRecord::Relation (as Relation)
  • Support for belongs_to, has_many and has_one_through associations

Future additions

  • Conversion to a gem
  • Additional ORM functionality:
    • Chainable, lazy joins
    • Eager loading with includes
    • Polymorphic associations

About

Hand-rolled implementation of the basic functionality of Ruby on Rails and Active Record

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published