[ANN] 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](http://guides.rubyonrails.org/3_1_release_notes.html). For a less attractive list of changes, please continue to read!

In order to help you make the most of your time in understanding changes for Rails 3.1.0, I've made a handy guide. Simply answer the following question, and I'll tell you where to get info about changes in Rails 3.1:

How much time do you have on your hands?

a) Not that much.

b) I have time to click some links and browse around for a bit.

c) I have *way* too much time on my hands.

If you answered a, then you should read the rest of this announcement.

If you answered b, then check out each of the CHANGELOG files checked in to the [Rails repository on github](http://github.com/rails/rails).

If you answered c, then please check out the [commit list between Rails 3.0.10 and 3.1.0](https://github.com/rails/rails/compare/v3.0.10...v3.1.0).

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

## [ActionPack](https://github.com/rails/rails/blob/3-1-stable/actionpack/CHANGELOG)

* ActionPack has been updated to include the new asset pipeline. Please see the [rails guides on the asset pipeline](http://edgeguides.rubyonrails.org/asset_pipeline.html).

* 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](https://github.com/rails/rails/blob/3-1-stable/activemodel/CHANGELOG)

* `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](https://github.com/rails/rails/blob/3-1-stable/activeresource/CHANGELOG)

* 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](https://github.com/rails/rails/blob/3-1-stable/activesupport/CHANGELOG)

* 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](https://github.com/rails/rails/blob/3-1-stable/railties/CHANGELOG)

* 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

### 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

···

--
Aaron Patterson
http://tenderlovemaking.com/

Great work, thanks

···

On Wed, Aug 31, 2011 at 11:45 AM, Aaron Patterson <aaron@tenderlovemaking.com> wrote:

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](http://guides.rubyonrails.org/3_1_release_notes.html\). For a less attractive list of changes, please continue to read!

In order to help you make the most of your time in understanding changes for Rails 3.1.0, I've made a handy guide. Simply answer the following question, and I'll tell you where to get info about changes in Rails 3.1:

How much time do you have on your hands?

a) Not that much.

b) I have time to click some links and browse around for a bit.

c) I have *way* too much time on my hands.

If you answered a, then you should read the rest of this announcement.

If you answered b, then check out each of the CHANGELOG files checked in to the [Rails repository on github](http://github.com/rails/rails\).

If you answered c, then please check out the [commit list between Rails 3.0.10 and 3.1.0](https://github.com/rails/rails/compare/v3.0.10...v3.1.0\).

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

## [ActionPack](https://github.com/rails/rails/blob/3-1-stable/actionpack/CHANGELOG\)

* ActionPack has been updated to include the new asset pipeline. Please see the [rails guides on the asset pipeline](http://edgeguides.rubyonrails.org/asset_pipeline.html\).

* 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](https://github.com/rails/rails/blob/3-1-stable/activemodel/CHANGELOG\)

* `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](https://github.com/rails/rails/blob/3-1-stable/activeresource/CHANGELOG\)

* 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](https://github.com/rails/rails/blob/3-1-stable/activesupport/CHANGELOG\)

* 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](https://github.com/rails/rails/blob/3-1-stable/railties/CHANGELOG\)

* 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

### 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

--
Aaron Patterson
http://tenderlovemaking.com/

--
Keep It Simple Stupid
Twitter: @ghosTM55

Aaron Patterson wrote in post #1019311:

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](http://guides.rubyonrails.org/3_1_release_notes.html\).

Trying to read raw html is not awesome:

<div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">has_many
:things, :conditions => proc { ["foo = ?", bar] }
</pre><p></p>
</div>
<p></p>
<ul>
    <li>Previously <tt>:insert_sql</tt> and <tt>:delete_sql</tt> on
<tt>has_and_belongs_to_many</tt> association allowed you to call
‘record’ to get the record being inserted or deleted. This is now passed
as an argument to the proc.</li>
</ul>
<ul>
    <li>Added <tt>ActiveRecord::Base#has_secure_password</tt> (via
<tt>ActiveModel::SecurePassword</tt>) to encapsulate dead-simple
password usage with BCrypt encryption and salting.
<div class="code_container">

<div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">
    <li>Schema: User(name:string, password_digest:string,
password_salt:string)
class User < ActiveRecord::Base
  has_secure_password
end
</li></pre>
</div>

</div></li></ul>
<ul>
    <li>When a model is generated <tt>add_index</tt> is added by default
for <tt>belongs_to</tt> or <tt>references</tt> columns.</li>
</ul>
<ul>
    <li>Setting the id of a <tt>belongs_to</tt> object will update the
reference to the object.</li>
</ul>
<ul>
    <li><tt>ActiveRecord::Base#dup</tt> and
<tt>ActiveRecord::Base#clone</tt> semantics have changed to closer match
normal Ruby dup and clone semantics.</li>
</ul>
<ul>
    <li>Calling <tt>ActiveRecord::Base#clone</tt> will result in a
shallow copy of the record, including copying the frozen state. No
callbacks will be called.</li>
</ul>
<ul>
    <li>Calling <tt>ActiveRecord::Base#dup</tt> will duplicate the
record, including calling after initialize hooks. Frozen state will not
be copied, and all associations will be cleared. A duped record will
return <tt>true</tt> for <tt>new_record?</tt>, have a <tt>nil</tt> id
field, and is saveable.</li>
</ul>
<ul>
    <li>The query cache now works with prepared statements. No changes
in the applications are required.</li>
</ul>
<h3 id="active-model">7 Active Model</h3>
<ul>
    <li><tt>attr_accessible</tt> accepts an option <tt>:as</tt> to
specify a role.</li>
</ul>
<ul>
    <li><tt>InclusionValidator</tt>, <tt>ExclusionValidator</tt>, and
<tt>FormatValidator</tt> now accepts an option which can be a proc, a
lambda, or anything that respond to <tt>call</tt>. This option will be
called with the current record as an argument and returns an object
which respond to <tt>include?</tt> for <tt>InclusionValidator</tt> and
<tt>ExclusionValidator</tt>, and returns a regular expression object for
<tt>FormatValidator</tt>.</li>
</ul>
<ul>
    <li>Added <tt>ActiveModel::SecurePassword</tt> to encapsulate
dead-simple password usage with BCrypt encryption and salting.</li>
</ul>
<ul>
    <li><tt>ActiveModel::AttributeMethods</tt> allows attributes to be
defined on demand.</li>
</ul>
<ul>
    <li>Added support for selectively enabling and disabling
observers.</li>
</ul>
<ul>
    <li>Alternate <tt>I18n</tt> namespace lookup is no longer
supported.</li>
</ul>
<h3 id="active-resource">8 Active Resource</h3>
<ul>
    <li>The default format has been changed to <span
class="caps">JSON</span> for all requests. If you want to continue to
use <span class="caps">XML</span> you will need to set <tt>self.format =
:xml</tt> in the class. For example,</li>
</ul>
<div class="code_container">
<pre class="brush: ruby; gutter: false; toolbar: false">class User <
ActiveResource::Base
  self.format = :xml
end
</pre>
</div>
<h3 id="active-support">9 Active Support</h3>
<ul>
    <li><tt>ActiveSupport::Dependencies</tt> now raises
<tt>NameError</tt> if it finds an existing constant in
<tt>load_missing_constant</tt>.</li>
</ul>
<ul>
    <li>Added a new reporting method <tt>Kernel#quietly</tt> which
silences both <tt>STDOUT</tt> and <tt>STDERR</tt>.</li>
</ul>
<ul>
    <li>Added <tt>String#inquiry</tt> as a convenience method for
turning a String into a <tt>StringInquirer</tt> object.</li>
</ul>
<ul>
    <li>Added <tt>Object#in?</tt> to test if an object is included in
another object.</li>
</ul>
<ul>
    <li><tt>LocalCache</tt> strategy is now a real middleware class and
no longer an anonymous class.</li>
</ul>
<ul>
    <li><tt>ActiveSupport::Dependencies::ClassCache</tt> class has been
introduced for holding references to reloadable classes.</li>
</ul>
<ul>
    <li><tt>ActiveSupport::Dependencies::Reference</tt> has been
refactored to take direct advantage of the new <tt>ClassCache</tt>.</li>
</ul>
<ul>
    <li>Backports <tt>Range#cover?</tt> as an alias for
<tt>Range#include?</tt> in Ruby 1.8.</li>
</ul>
<ul>
    <li>Added <tt>weeks_ago</tt> and <tt>prev_week</tt> to
Date/DateTime/Time.</li>
</ul>
<ul>
    <li>Added <tt>before_remove_const</tt> callback to
<tt>ActiveSupport::Dependencies.remove_unloadable_constants!</tt>.</li>
</ul>
<p>Deprecations:</p>
<ul>
    <li><tt>ActiveSupport::SecureRandom</tt> is deprecated in favor of
<tt>SecureRandom</tt> from the Ruby standard library.</li>
</ul>
<h3 id="credits">10 Credits</h3>
<p>See the <a href="http://contributors.rubyonrails.org/&quot;&gt;full list of
contributors to Rails</a> for the many people who spent many hours
making Rails, the stable and robust framework it is. Kudos to all of
them.</p>
<p>Rails 3.1 Release Notes were compiled by <a
href="https://github.com/vijaydev&quot;&gt;Vijay Dev</a>.</p>

        <h3>Feedback</h3>
        <p>
          You're encouraged to help improve the quality of this guide.
        </p>
        <p>
          If you see any typos or factual errors you are confident to
          patch, please clone <a
href="https://github.com/lifo/docrails&quot;&gt;docrails&lt;/a&gt;
          and push the change yourself. That branch of Rails has public
write access.
          Commits are still reviewed, but that happens after you've
submitted your
          contribution. <a
href="https://github.com/lifo/docrails&quot;&gt;docrails&lt;/a&gt; is
          cross-merged with master periodically.
        </p>
        <p>
          You may also find incomplete content, or stuff that is not up
to date.
          Please do add any missing documentation for master. Check the
          <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails
Guides Guidelines</a>
          for style and conventions.
        </p>
        <p>And last but not least, any kind of discussion regarding Ruby
on Rails
          documentation is very welcome in the <a
href="http://groups.google.com/group/rubyonrails-docs&quot;&gt;rubyonrails\-docs
mailing list</a>.
        </p>

···

--
Posted via http://www.ruby-forum.com/\.