Skip to content

Instantly share code, notes, and snippets.

Ruby on Rails 3.0 Release Notes

Rails 3.0 is a landmark release as it delivers on the Merb/Rails merge promise made in December 2008. Rails 3.0 provides many major upgrades to all of the major components of Rails, including a major overhaul of the router and query APIs.

One of the major achievements of this release, is that while there are loads of new features, old APIs have been deprecated with warnings wherever possible, so that you can implement the new features and conventions at your own pace. There is a backwards compatibility layer that will be supported during 3.0.x and removed in 3.1.

Rails 3.0 adds Active Model ORM abstraction, Abstract Controller generic controller abstraction as well as a consistent Plugin API giving developers full access to all the Rails internals that make Action Mailer, Action Controller, Action View, Active Record and Active Resource work.

These release notes cover the major upgrades, but don’t include every little bug fix and change. If you want to see everything,

Article.all(:conditions => { 'title' => { '$exists' => true }, 'description' => { '$exists' => true },
'$where' => "this.title.match(/#{params[:keyword]}/i) || this.description.match(/#{params[:keyword]}/i)"})
today = Date.today
User.all(:created_at => { '$gt' => today.to_time, '$lt' => (today + 1.day).to_time })
User.all(:email => /thony/i)
class User
key :profile, Profile
end
class Announce
belongs_to :user
key :user_id, ObjectId
end
a.pictures.delete_if{ |picture| picture.name == 'test' }
picture = a.pictures.select{ |picture| picture.name == 'test' }.first
picture.name = 'testtesttest'
a.save
pictures = a.pictures.select{ |picture| picture.type == 'jpg' }
a = Announce.new
a.pictures << Picture.new(:name => 'test')
a.save