rodovich / inactive-record

Reimplementation of a tiny subset of Active Record

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inactive Record

irb -r ./inactive_record.rb
class Project < InactiveRecord::Base
  belongs_to :user
end

class User < InactiveRecord::Base
  has_many :projects
end

User.where(admin: true).first.projects.order(:name).map(&:name)

About

Reimplementation of a tiny subset of Active Record


Languages

Language:Ruby 100.0%