Active Record Rules

Posted by Kerry Tue, 23 May 2006 17:02:00 GMT

Here is how much code it takes to get ActiveRecord working.

  require 'active_record/base'

  ActiveRecord::Base.establish_connection(
    :adapter  => "postgresql",
    :host     => "blah",
    :username => "blah",
    :password => "blah",
    :database => "database"
  )

  class User < ActiveRecord::Base
  end

  puts User.find(:first).id

It’s very cool. I’m sure there’s probably plenty of stuff Hibernate can do that ActiveRecord cannot, but you can’t beat it for just getting stuff done, without arsing about with config files.

Comments

Leave a response

Comments