medellinrb / activerecord-internals

ActiveRecord Internals talk. Code and Resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

activerecord-internals (aka EmpanadaRecord)

ActiveRecord Internals talk. Code and Resources

Talk slides here

EmpanadaRecord

Our just-for-fun implementation of Active Record pattern

Our rails inspired API:

class Product < EmpanadaRecord::Base
  attr_accessor :id, :name

  #...
end

Product.all             # retrieves all products in DB
Product.find(99)        # retrieve a product with ID=99

Today Kata

Fork and grow EmpanadaRecord. Pull Requests are welcome

Some ideas:

  • Implement all, count, first, last, where, etc
  • Implement find_by_attribute (dynamic attributes)
  • Add support for multiple DB adapters (see Adapter pattern)
  • Improve DB setup/teardown in tests

About

ActiveRecord Internals talk. Code and Resources


Languages

Language:Ruby 100.0%