ActiveRecord Internals talk. Code and Resources
Talk slides here
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
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