Update CHANGELOGs.

This commit is contained in:
José Valim 2011-05-06 05:53:27 +02:00
parent 7adfd02b3f
commit 41a6d96c1b
3 changed files with 18 additions and 21 deletions

@ -114,8 +114,6 @@ tested.
Keys are dasherized. Values are JSON-encoded, except for strings and symbols. [Stephen Celis]
* Added render :once. You can pass either a string or an array of strings and Rails will ensure they each of them are rendered just once. [José Valim]
* Deprecate old template handler API. The new API simply requires a template handler to respond to call. [José Valim]
* :rhtml and :rxml were finally removed as template handlers. [José Valim]

@ -1,5 +1,7 @@
*Rails 3.1.0 (unreleased)*
* attr_accessible and friends now accepts :as as option to specify a role [Josh Kalderimis]
* Add support for proc or lambda as an option for InclusionValidator,
ExclusionValidator, and FormatValidator [Prem Sichanugrist]

@ -1,5 +1,20 @@
*Rails 3.1.0 (unreleased)*
* AR#new, AR#create and AR#update_attributes all accept a second hash as option that allows you
to specify which role to consider when assigning attributes. This is built on top of ActiveModel's
new mass assignment capabilities:
class Post < ActiveRecord::Base
attr_accessible :title
attr_accessible :title, :published_at, :as => :admin
end
Post.new(params[:post], :as => :admin)
assign_attributes() with similar API was also added and attributes=(params, guard) was deprecated.
[Josh Kalderimis]
* default_scope can take a block, lambda, or any other object which responds to `call` for lazy
evaluation:
@ -22,25 +37,7 @@
[Jon Leighton]
* Calling 'default_scope' multiple times in a class (including when a superclass calls
'default_scope') is deprecated. The current behavior is that this will merge the default
scopes together:
class Post < ActiveRecord::Base # Rails 3.1
default_scope where(:published => true)
default_scope where(:hidden => false)
# The default scope is now: where(:published => true, :hidden => false)
end
In Rails 3.2, the behavior will be changed to overwrite previous scopes:
class Post < ActiveRecord::Base # Rails 3.2
default_scope where(:published => true)
default_scope where(:hidden => false)
# The default scope is now: where(:hidden => false)
end
If you wish to merge default scopes in special ways, it is recommended to define your default
* If you wish to merge default scopes in special ways, it is recommended to define your default
scope as a class method and use the standard techniques for sharing code (inheritance, mixins,
etc.):