[ANN] Rails 3.1.1.rc2

Hi everyone,

Rails 3.1.1.rc2 has been released. Please give it a try, it’s our chance to fix regressions you might find and make a beautiful 3.1.1 stable release. If there are no regressions I will be releasing 3.1.1 final next October 3rd. If you find any regression please contact me ASAP by email, twitter or github.

CHANGES

Action Mailer

  • No changes

Action Pack

  • Allow asset tag helper methods to accept :digest => false option in order to completely avoid the digest generation. Useful for linking assets from static html files or from emails when the user could probably look at an older html email with an older asset. [Santiago Pastorino]

  • Don’t mount Sprockets server at config.assets.prefix if config.assets.compile is false. [Mark J. Titorenko]

  • Set relative url root in assets when controller isn’t available for Sprockets (eg. Sass files using asset_path). Fixes #2435 [Guillermo Iguaran]

  • Fix basic auth credential generation to not make newlines. GH #2882

  • Fixed the behavior of asset pipeline when config.assets.digest and config.assets.compile are false and requested asset isn’t precompiled. Before the requested asset were compiled anyway ignoring that the config.assets.compile flag is false. [Guillermo Iguaran]

  • CookieJar is now Enumerable. Fixes #2795

  • Fixed AssetNotPrecompiled error raised when rake assets:precompile is compiling certain .erb files. See GH #2763 #2765 #2805 [Guillermo Iguaran]

  • Manifest is correctly placed in assets path when default assets prefix is changed. Fixes #2776 [Guillermo Iguaran]

  • Fixed stylesheet_link_tag and javascript_include_tag to respect additional options passed by the users when debug is on. [Guillermo Iguaran]

  • Fix ActiveRecord#exists? when passsed a nil value

  • Fix assert_select_email to work on multipart and non-multipart emails as the method stopped working correctly in Rails 3.x due to changes in the new mail gem.

Active Model

  • Remove hard dependency on bcrypt-ruby to avoid make ActiveModel dependent on a binary library. You must add the gem explicitly to your Gemfile if you want use ActiveModel::SecurePassword:

    gem ‘bcrypt-ruby’, ‘~> 3.0.0’

    See GH #2687. [Guillermo Iguaran]

Active Record

  • Add deprecation for the preload_associations method. Fixes #3022.

    [Jon Leighton]

  • Don’t require a DB connection when loading a model that uses set_primary_key. GH #2807.

    [Jon Leighton]

  • Fix using select() with a habtm association, e.g. Person.friends.select(:name). GH #3030 and #2923.

    [Hendy Tanata]

  • Fix belongs_to polymorphic with custom primary key on target. GH #3104.

    [Jon Leighton]

  • CollectionProxy#replace should change the DB records rather than just mutating the array. Fixes #3020.

    [Jon Leighton]

  • LRU cache in mysql and sqlite are now per-process caches.

    • lib/active_record/connection_adapters/mysql_adapter.rb: LRU cache keys are per process id.
    • lib/active_record/connection_adapters/sqlite_adapter.rb: ditto
  • Database adapters use a statement pool for limiting the number of open prepared statments on the database. The limit defaults to 1000, but can be adjusted in your database config by changing ‘statement_limit’.

  • Fix clash between using ‘preload’, ‘joins’ or ‘eager_load’ in a default scope and including the default scoped model in a nested through association. (GH #2834.) [Jon Leighton]

  • Ensure we are not comparing a string with a symbol in HasManyAssociation#inverse_updates_counter_cache?. Fixes GH #2755, where a counter cache could be decremented twice as far as it was supposed to be.

    [Jon Leighton]

  • Don’t send any queries to the database when the foreign key of a belongs_to is nil. Fixes GH #2828. [Georg Friedrich]

  • Fixed find_in_batches method to not include order from default_scope. See GH #2832 [Arun Agrawal]

  • Don’t compute table name for abstract classes. Fixes problem with setting the primary key in an abstract class. See GH #2791. [Akira Matsuda]

  • Psych errors with poor yaml formatting are proxied. Fixes GH #2645 and GH #2731

  • Use the LIMIT word with the methods #last and #first. Fixes GH #2783 [Damien Mathieu]

Active Resource

  • No changes

Active Support

  • Fixed performance issue where TimeZone lookups would require tzinfo each time [Tim Lucas]

  • ActiveSupport::OrderedHash is now marked as extractable when using Array#extract_options! [Prem Sichanugrist]

Railties

  • Add jquery-rails to Gemfile of plugins, test/dummy app needs it. Closes #3091. [Santiago Pastorino]

  • rake assets:precompile loads the application but does not initialize it.

    To the app developer, this means configuration add in config/initializers/* will not be executed.

    Plugins developers need to special case their initializers that are meant to be run in the assets group by adding :group => :assets.

You can find an exhaustive list of changes on github. Along with the closed issues marked for v3.1.1. You can also take a look to what’s new between v3.1.1.rc1 and v3.1.1.rc2

You can also see issues we haven’t closed yet.

Thanks to everyone!

[ANN] Rails 3.1.1.rc1

Hi everyone,

Rails 3.1.1.rc1 has been released. Please give it a try, it’s our chance to fix regressions you might find and make a beautiful 3.1.1 stable release. If there are no regressions I will be releasing 3.1.1 final next September 16th during GoGaRuCo.

CHANGES

Action Mailer

  • No changes

Action Pack

  • Allow asset tag helper methods to accept :digest => false option in order to completely avoid the digest generation. Useful for linking assets from static html files or from emails when the user could probably look at an older html email with an older asset. [Santiago Pastorino]

  • Don’t mount Sprockets server at config.assets.prefix if config.assets.compile is false. [Mark J. Titorenko]

  • Set relative url root in assets when controller isn’t available for Sprockets (eg. Sass files using asset_path). Fixes #2435 [Guillermo Iguaran]

  • Fix basic auth credential generation to not make newlines. GH #2882

  • Fixed the behavior of asset pipeline when config.assets.digest and config.assets.compile are false and requested asset isn’t precompiled. Before the requested asset were compiled anyway ignoring that the config.assets.compile flag is false. [Guillermo Iguaran]

  • CookieJar is now Enumerable. Fixes #2795

  • Fixed AssetNotPrecompiled error raised when rake assets:precompile is compiling certain .erb files. See GH #2763 #2765 #2805 [Guillermo Iguaran]

  • Manifest is correctly placed in assets path when default assets prefix is changed. Fixes #2776 [Guillermo Iguaran]

  • Fixed stylesheet_link_tag and javascript_include_tag to respect additional options passed by the users when debug is on. [Guillermo Iguaran]

  • Fix ActiveRecord#exists? when passsed a nil value

  • Fix assert_select_email to work on multipart and non-multipart emails as the method stopped working correctly in Rails 3.x due to changes in the new mail gem.

Active Model

  • Remove hard dependency on bcrypt-ruby to avoid make ActiveModel dependent on a binary library. You must add the gem explicitly to your Gemfile if you want use ActiveModel::SecurePassword:

    gem ‘bcrypt-ruby’, ‘~> 3.0.0’

    See GH #2687. [Guillermo Iguaran]

Active Record

  • LRU cache in mysql and sqlite are now per-process caches.

    • lib/active_record/connection_adapters/mysql_adapter.rb: LRU cache keys are per process id.
    • lib/active_record/connection_adapters/sqlite_adapter.rb: ditto
  • Database adapters use a statement pool for limiting the number of open prepared statments on the database. The limit defaults to 1000, but can be adjusted in your database config by changing ‘statement_limit’.

  • Fix clash between using ‘preload’, ‘joins’ or ‘eager_load’ in a default scope and including the default scoped model in a nested through association. (GH #2834.) [Jon Leighton]

  • Ensure we are not comparing a string with a symbol in HasManyAssociation#inverse_updates_counter_cache?. Fixes GH #2755, where a counter cache could be decremented twice as far as it was supposed to be.

    [Jon Leighton]

  • Don’t send any queries to the database when the foreign key of a belongs_to is nil. Fixes GH #2828. [Georg Friedrich]

  • Fixed find_in_batches method to not include order from default_scope. See GH #2832 [Arun Agrawal]

  • Don’t compute table name for abstract classes. Fixes problem with setting the primary key in an abstract class. See GH #2791. [Akira Matsuda]

  • Psych errors with poor yaml formatting are proxied. Fixes GH #2645 and GH #2731

  • Use the LIMIT word with the methods #last and #first. Fixes GH #2783 [Damien Mathieu]

Active Resource

  • No changes

Active Support

  • Fixed performance issue where TimeZone lookups would require tzinfo each time [Tim Lucas]

  • ActiveSupport::OrderedHash is now marked as extractable when using Array#extract_options! [Prem Sichanugrist]

Railties

  • No changes

You can find an exhaustive list of changes on github. Along with the closed issues marked for v3.1.1.

You can also see issues we haven’t closed yet.

Thanks to everyone!

Rails 3.1.0 has been released!

Hi everybody!

It’s been 3 Months since RailsConf, so I think it’s time we released Rails 3.1.0. So, here it is! I’ve released Rails 3.1.0!

CHANGES

For a much more attractive and easy to read list of changes, please check out the awesome Rails 3.1.0 Release Notes on the Rails Guides site. For a less attractive list of changes, please continue to read!

Here are some highlights of the major changes in Rails 3.1.0:

ActionPack

  • ActionPack has been updated to include the new asset pipeline. Please see the rails guides on the asset pipeline.

  • Streaming response support has been added. This feature allows you to stream templates to the user before processing has actually finished. See the Rails Guides, or documentation in ActionController::Metal::Streaming for more information. Middleware have been refactored to support this feature.

  • RJS has been extracted to a gem.

ActiveModel

  • attr_accessible and friends now accepts :as as option to specify a role

  • Added ActiveModel::SecurePassword to encapsulate dead-simple password usage with BCrypt encryption and salting.

ActiveRecord

  • Prepared statement caches have been integrated. ActiveRecord::Base#create and simple finders will use a prepared statement and cache for more performant inserts and selects.

  • Associations have been refactored for greater simplicity and maintainability.

  • default_scope can take any object that responds to call.

  • PostgreSQL adapter only supports PostgreSQL version 8.2 and higher.

  • Migrations use instance methods rather than class methods. Rather than defining a self.up method, you should define an instance method up.

  • Migrations are reversible. When a new migration is generated, the migration will contain one method called change. Database changes made in this method will automatically know how to reverse themselves. For more information, see the documentation for ActiveRecord::Migration and ActiveRecord::Migration::CommandRecorder.

  • When a model is generated, add_index is added by default for belongs_to or references columns.

ActiveResource

  • The default format has been changed to JSON for all requests. If you want to continue to use XML you will need to set self.format = :xml in the class.

ActiveSupport

  • ActiveSupport::BufferedLogger set log encoding to BINARY, but still use text mode to output portable newlines.

  • Add Object#in? to test if an object is included in another object.

  • ActiveSupport::Dependencies::ClassCache class has been introduced for holding references to reloadable classes.

  • Added weeks_ago and prev_week to Date/DateTime/Time.

  • JSON decoding now uses the multi_json gem which also vendors a json engine called OkJson. The yaml backend has been removed in favor of OkJson as a default engine for 1.8.x, while the built in 1.9.x json implementation will be used by default.

Railties

  • The default database schema file is written as UTF-8.

  • Rack::Sendfile middleware is used only if x_sendfile_header is present.

  • Add alias r for rails runner.

  • jQuery is the new default JavaScript library.

  • Added config.force_ssl configuration which loads Rack::SSL middleware and force all requests to be under HTTPS protocol

For more info

For a more detailed list of changes, please see each of the CHANGELOG files checked in to the Rails repository on github.

For an even more detailed list of changes, please see the commit list between Rails 3.0.10 and 3.1.0.

The End

I am personally very proud of this release. I want to say thank you to the people testing our release candidates, the people submitting patches and sending in bug reports. I think that Rails 3.1.0 is the best release of Rails to date, and we could not have done it without you.

Please continue to create amazing things with this framework!

SHA-1

  • b68f74ced662145a4139409edf3c51db1159ead8 actionmailer-3.1.0.gem
  • 136474f270677ae75ad0f9599d26e89cf1d4bc7b actionpack-3.1.0.gem
  • e6b68453c08bb0da52ed1d422ba2f87a5e3aa794 activemodel-3.1.0.gem
  • dfbae15c0d395304812c22fbf18aa9daadbe20b4 activerecord-3.1.0.gem
  • 3f1f547e500d1ffc1f7c3ee4ab9eb1526157a870 activeresource-3.1.0.gem
  • f21627c2f429abfa8685d2147fadab6704c13869 activesupport-3.1.0.gem
  • 21c6592189fb358a066846754a8f7ce7a238fca6 rails-3.1.0.gem
  • 79cfa1eca232de9a45453829287e4438089b7955 railties-3.1.0.gem

<3 <3 <3

The Ruby on Rails API Switches to SDoc

The Ruby on Rails API is switching to SDoc starting with 3.1.

SDoc is a RDoc format created by Володя Колесников (@voloko) that has been powering railsapi.com for a long time.

Among other things, SDoc provides a search box with fuzzy match completion, tree browsing, keyboard navigation, and a really nice template.

You can already see the upgrade in the edge API.

We’d like to thank very much Володя for his work updating SDoc for the official API. Thanks man!

[ANN] Rails 3.1.0.rc8

Hi everyone,

Rails 3.1.0.rc8 has been released (we’ve an issue with rc7). This is the final release candidate. Please give it a try, it’s our last chance to fix regressions and severe issues. We will be releasing final 3.1.0 next August 30th.

CHANGES

Check the CHANGELOG file of each framework to see what we’ve changed.

You can find an exhaustive list of changes on github. Along with the closed issues marked for v3.1.0.

You can also see issues we haven’t closed.

A comprehensive CHANGELOG will be announced when 3.1.0 final is released.

Thanks!

[ANN] Rails 3.1.0.rc6

Hi everyone,

Rails 3.1.0.rc6 has been released. This release contains critical security fixes.

CHANGES

You can find an exhaustive list of changes on github. Along with the closed issues marked for v3.1.0.

You can also see issues we haven’t closed.

A comprehensive CHANGELOG will be announced when 3.1.0 final is released. Barring any show stopping bugs, Rails 3.1.0 will be released on August 30th.

4 Security Fixes

Please follow the links to see specific information about each vulnerability, along with individual patches for fixing them.

Please note that these security fixes do not have CVE identifiers. We requested identifiers on August 5th, and have yet to received a response. When we get identifiers, we’ll update the notices with those values.

Also remember to subscribe to the Ruby on Rails Security mailing list.

Why was this release delayed?

You may have noticed this release was originally slated to be released on August 8th. We decided to delay the release in order to obtain CVE identifiers. Unfortunately, identifiers still have not been issued. We felt that getting the security fixes to our users was more important than obtaining CVE values.

That is why our release is late, and contains no CVE identifiers.

THE END

Thanks! <3

[ANN] Rails 3.0.10

Hi everyone,

Rails 3.0.10 has been released. This release contains critical security fixes.

CHANGES

You can find an exhaustive list of changes on github. Here are some notable excerpts:

4 Security Fixes

Please follow the links to see specific information about each vulnerability, along with individual patches for fixing them.

Please note that these security fixes do not have CVE identifiers. We requested identifiers on August 5th, and have yet to received a response. When we get identifiers, we’ll update the notices with those values.

Also remember to subscribe to the Ruby on Rails Security mailing list.

ActionPack:

  • Fixes an issue where cache sweepers with only after filters would have no controller object, it would raise undefined method controller_name for nil [jeroenj]
  • Ensure status codes are logged when exceptions are raised.
  • Subclasses of OutputBuffer are respected.
  • Fixed ActionView::FormOptionsHelper#select with :multiple => false
  • Avoid extra call to Cache#read in case of a fragment cache hit

ActiveRecord:

  • Magic encoding comment added to schema.rb files
  • schema.rb is written as UTF-8 by default.
  • Ensuring an established connection when running rake db:schema:dump
  • Association conditions will not clobber join conditions.
  • Destroying a record will destroy the HABTM record before destroying itself. GH #402.
  • Make ActiveRecord::Batches#find_each to not return self.
  • Update table_exists? in PG to to always use current search_path or schema if explictly set.

Why was this release delayed?

You may have noticed this release was originally slated to be released on August 8th. We decided to delay the release in order to obtain CVE identifiers. Unfortunately, identifiers still have not been issued. We felt that getting the security fixes to our users was more important than obtaining CVE values.

That is why our release is late, and contains no CVE identifiers.

THE END

Thanks! <3

[ANN] Rails 2.3.14

Hi everyone,

Rails 2.3.14 has been released. This release contains critical security fixes.

CHANGES

You can find an exhaustive list of changes on github. Here are some notable excerpts:

4 Security Fixes

Please follow the links to see specific information about each vulnerability, along with individual patches for fixing them.

Also remember to subscribe to the Ruby on Rails Security mailing list.

2 Bug Fixes

  • Rescue from RDoc task errors
  • OrderedHash can merge with blocks

THE END

Thanks! <3

[ANN] Rails 3.0.10.rc1 has been released!

Hi everyone,

Rails 3.0.10.rc1 has been released. As usual, please try out this release candidate and report any issues to the ruby on rails core mailing list. If no issues are found, we’ll release 3.0.10 on August 8th (around 5pm PDT).

If you do find issues, please send them to the rails core mailing list. If the release candidate is found to not be backwards compatible with the previous release, we’ll do another release candidate and postpone the final release date.

Remember that this is your chance to veto / postpone the rails release. Please take this opportunity to test!

CHANGES

You can find an exhaustive list of changes on github. Here are some notable excerpts:

From ActionPack:

  • Fixes an issue where cache sweepers with only after filters would have no controller object, it would raise undefined method controller_name for nil [jeroenj]

  • Ensure status codes are logged when exceptions are raised.

  • Subclasses of OutputBuffer are respected.

  • Fixed ActionView::FormOptionsHelper#select with :multiple => false

  • Avoid extra call to Cache#read in case of a fragment cache hit

From ActiveRecord:

  • Magic encoding comment added to schema.rb files

  • schema.rb is written as UTF-8 by default.

  • Ensuring an established connection when running rake db:schema:dump

  • Association conditions will not clobber join conditions.

  • Destroying a record will destroy the HABTM record before destroying itself. GH #402.

  • Make ActiveRecord::Batches#find_each to not return self.

  • Update table_exists? in PG to to always use current search_path or schema if explictly set.

THE END

Thanks!

-Aaron <3

Rails now tested on Travis CI

Setting up continuous integration for Rails has been a complicated undertaking in the past.

Rails needs to be tested against different Ruby versions and various modes (such as running test cases in isolation/non-isolation, running ActiveRecord with identitymap enabled/disabled). This made the test suite run for an isanely long time (up to 2 hours on 1.9.2 alone) and required regular maintenance by
the Rails core team.

Over the past weeks the folks at Travis CI have been working hard to provide a better experience to Rails continous integration and today we can happily announce that
Rails is now testing on Travis CI!

Travis CI is doing a great job in providing multi-ruby testing capabilities and it is dead-simple to use. There’s some great potential to this project and it might change the way we see open-source development and testing quite a bit.

So, if you are publishing any kind of open-source code, library or web application, we recommend you have a look at it. And if you have a spare hour once in a while then consider potentially jumping on board to help improve the code base.

Travis CI is using a separate physical worker server (and a quite beefy one!) for running workers dedicated to Rails builds. This server has kindly been sponsored by the great folks over at Enterprise Rails.

[Guest post by Josh Kalderimis & Sven Fuchs]