Frameworks56k+ stars

Ruby on Rails

Web development that doesn't hurt

Commit Details

Message
"Initial"
Author
David Heinemeier Hansson
Date
2004-11-24
Hash
db045dbbf60b53dbe013ef25554fd013baf88134

Fun Fact

DHH extracted Rails from Basecamp, a project management tool. He famously created a blog in 15 minutes to demo Rails' power.

</>First Code

Ruby
# Active Record -- Object-relation mapping put on rails
#
# Copyright (c) 2004 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person

module ActiveRecord
  class Base
    def self.find(id)
      # Magic happens here
    end
    
    def self.create(attributes = nil)
      object = new(attributes)
      object.save
      object
    end
    
    def save
      # INSERT INTO ... or UPDATE ...
    end
  end
end