1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

synchronize 4.1 release notes with CHANGELOGS. [ci skip]

/cc @chancancode
This commit is contained in:
Yves Senn 2014-02-06 11:43:16 +01:00
parent b9ead0feb0
commit 580f0b61dc
5 changed files with 95 additions and 17 deletions

View file

@ -91,7 +91,7 @@
*Andrew White* *Andrew White*
* Show full route constraints in error message * Show full route constraints in error message.
When an optimized helper fails to generate, show the full route constraints When an optimized helper fails to generate, show the full route constraints
in the error message. Previously it would only show the contraints that were in the error message. Previously it would only show the contraints that were

View file

@ -59,14 +59,16 @@
*Lauro Caetano* *Lauro Caetano*
* Fix regressions on `select_*` methods. * Fix regressions on `select_*` methods.
When `select_*` methods receive a `Relation` object, they should be able to get the arel/binds from it. When `select_*` methods receive a `Relation` object, they should be able to
get the arel/binds from it.
Also fix regressions on `select_rows` that was ignoring the binds. Also fix regressions on `select_rows` that was ignoring the binds.
Fixes #7538, #12017, #13731, #12056. Fixes #7538, #12017, #13731, #12056.
*arthurnn* *arthurnn*
* Active Record objects can now be correctly dumped, loaded and dumped again without issues. * Active Record objects can now be correctly dumped, loaded and dumped again
without issues.
Previously, if you did `YAML.dump`, `YAML.load` and then `YAML.dump` again Previously, if you did `YAML.dump`, `YAML.load` and then `YAML.dump` again
in an Active Record model that used serialization it would fail at the last in an Active Record model that used serialization it would fail at the last
@ -154,12 +156,14 @@
*Rafael Mendonça França* *Rafael Mendonça França*
* `has_one` and `belongs_to` accessors don't add ORDER BY to the queries anymore. * `has_one` and `belongs_to` accessors don't add ORDER BY to the queries
anymore.
Since Rails 4.0, we add an ORDER BY in the `first` method to ensure consistent results Since Rails 4.0, we add an ORDER BY in the `first` method to ensure
among different database engines. But for singular associations this behavior is not needed consistent results among different database engines. But for singular
since we will have one record to return. As this ORDER BY option can lead some performance associations this behavior is not needed since we will have one record to
issues we are removing it for singular associations accessors. return. As this ORDER BY option can lead some performance issues we are
removing it for singular associations accessors.
Fixes #12623. Fixes #12623.
@ -227,7 +231,7 @@
*Harry Brundage* *Harry Brundage*
* Enable partial indexes for sqlite >= 3.8.0 * Enable partial indexes for `sqlite >= 3.8.0`.
See http://www.sqlite.org/partialindex.html See http://www.sqlite.org/partialindex.html
@ -355,7 +359,7 @@
This ensures that `change_table` and `create_table` will use This ensures that `change_table` and `create_table` will use
similar objects. similar objects.
Fixes #13577 and #13503. Fixes #13577, #13503.
*Nishant Modak*, *Prathamesh Sonpatki*, *Rafael Mendonça França* *Nishant Modak*, *Prathamesh Sonpatki*, *Rafael Mendonça França*

View file

@ -12,7 +12,7 @@
*Hincu Petru* *Hincu Petru*
* Deprecate custom `BigDecimal` serialization * Deprecate custom `BigDecimal` serialization.
Deprecate the custom `BigDecimal` serialization that is included when requiring Deprecate the custom `BigDecimal` serialization that is included when requiring
`active_support/all` as a fix for #12467. Let Ruby handle YAML serialization `active_support/all` as a fix for #12467. Let Ruby handle YAML serialization
@ -76,7 +76,8 @@
*Andrew White* *Andrew White*
* Added `Hash#compact` and `Hash#compact!` for removing items with nil value from hash. * Added `Hash#compact` and `Hash#compact!` for removing items with nil value
from hash.
*Celestino Gomes* *Celestino Gomes*

View file

@ -175,6 +175,8 @@ conversation.active? # => false
conversation.status # => "archived" conversation.status # => "archived"
Conversation.archived # => Relation for all archived Conversations Conversation.archived # => Relation for all archived Conversations
Conversation.statuses # => { "active" => 0, "archived" => 1 }
``` ```
See its See its
@ -241,6 +243,7 @@ unless they use `xhr`. Upgrade your tests to be explicit about expecting
XmlHttpRequests. Instead of `post :create, format: :js`, switch to the explicit XmlHttpRequests. Instead of `post :create, format: :js`, switch to the explicit
`xhr :post, :create, format: :js`. `xhr :post, :create, format: :js`.
Railties Railties
-------- --------
@ -278,7 +281,7 @@ for detailed changes.
* Exposed `MiddlewareStack#unshift` to environment * Exposed `MiddlewareStack#unshift` to environment
configuration. ([Pull Request](https://github.com/rails/rails/pull/12479)) configuration. ([Pull Request](https://github.com/rails/rails/pull/12479))
* Add `Application#message_verifier` method to return a message * Added `Application#message_verifier` method to return a message
verifier. ([Pull Request](https://github.com/rails/rails/pull/12995)) verifier. ([Pull Request](https://github.com/rails/rails/pull/12995))
* The `test_help.rb` file which is required by the default generated test * The `test_help.rb` file which is required by the default generated test
@ -288,6 +291,7 @@ for detailed changes.
with `config.active_record.maintain_test_schema = false`. ([Pull with `config.active_record.maintain_test_schema = false`. ([Pull
Request](https://github.com/rails/rails/pull/13528)) Request](https://github.com/rails/rails/pull/13528))
Action Pack Action Pack
----------- -----------
@ -335,6 +339,18 @@ for detailed changes.
* Separated Action View completely from Action * Separated Action View completely from Action
Pack. ([Pull Request](https://github.com/rails/rails/pull/11032)) Pack. ([Pull Request](https://github.com/rails/rails/pull/11032))
* Log which keys were affected by deep
munge. ([Pull Request](https://github.com/rails/rails/pull/13813))
* New config option `config.action_dispatch.perform_deep_munge` to opt out of
params "deep munging" that was used to address security vulnerability
CVE-2013-0155. ([Pull Request](https://github.com/rails/rails/pull/13188))
* Added `:serializer` option for `config.session_store :cookie_store`. This
changes default serializer when using
`:cookie_store`. ([Pull Request](https://github.com/rails/rails/pull/13692))
Action Mailer Action Mailer
------------- -------------
@ -344,9 +360,13 @@ for detailed changes.
### Notable changes ### Notable changes
* Added mailer previews feature based on 37 Signals mail_view
gem. ([Commit](https://github.com/rails/rails/commit/d6dec7fcb6b8fddf8c170182d4fe64ecfc7b2261))
* Instrument the generation of Action Mailer messages. The time it takes to * Instrument the generation of Action Mailer messages. The time it takes to
generate a message is written to the log. ([Pull Request](https://github.com/rails/rails/pull/12556)) generate a message is written to the log. ([Pull Request](https://github.com/rails/rails/pull/12556))
Active Record Active Record
------------- -------------
@ -495,11 +515,32 @@ for detailed changes.
object. Helper methods used by multiple fixtures should be defined on modules object. Helper methods used by multiple fixtures should be defined on modules
included in `ActiveRecord::FixtureSet.context_class`. ([Pull Request](https://github.com/rails/rails/pull/13022)) included in `ActiveRecord::FixtureSet.context_class`. ([Pull Request](https://github.com/rails/rails/pull/13022))
* Don't create or drop the test database if RAILS_ENV is specified explicitly. * Don't create or drop the test database if RAILS_ENV is specified
explicitly. ([Pull Request](https://github.com/rails/rails/pull/13629))
* `Relation` no longer has mutator methods like `#map!` and `#delete_if`. Convert * `Relation` no longer has mutator methods like `#map!` and `#delete_if`. Convert
to an `Array` by calling `#to_a` before using these methods. ([Pull Request](https://github.com/rails/rails/pull/13314)) to an `Array` by calling `#to_a` before using these methods. ([Pull Request](https://github.com/rails/rails/pull/13314))
* `find_in_batches`, `find_each`, `Result#each` and `Enumerable#index_by` now
return an `Enumerator` that can calculate its
size. ([Pull Request](https://github.com/rails/rails/pull/13938))
* `scope` and `endum` now raise on "dangerous" name
conflicts. ([Pull Request](https://github.com/rails/rails/pull/13450))
* `second` through `fifth` methods act like the `first`
finder. ([Pull Request](https://github.com/rails/rails/pull/13757))
* Make `touch` fire the `after_commit` and `after_rollback`
callbacks. ([Pull Request](https://github.com/rails/rails/pull/12031))
* Enable partial indexes for `sqlite >=
3.8.0`. ([Pull Request](https://github.com/rails/rails/pull/13350))
* Make `change_column_null`
revertable. ([Commit](https://github.com/rails/rails/commit/724509a9d5322ff502aefa90dd282ba33a281a96))
Active Model Active Model
------------ ------------
@ -517,6 +558,13 @@ for detailed changes.
* Added new API methods `reset_changes` and `changes_applied` to * Added new API methods `reset_changes` and `changes_applied` to
`ActiveModel::Dirty` that control changes state. `ActiveModel::Dirty` that control changes state.
* Ability to specify multiple contexts when defining a
validation. ([Pull Request](https://github.com/rails/rails/pull/13754))
* `attribute_changed?` now accepts a hash to check if the attribute was changed
`:from` and/or `:to` a given
value. ([Pull Request](https://github.com/rails/rails/pull/13131))
Active Support Active Support
-------------- --------------
@ -570,6 +618,9 @@ for detailed changes.
* Remove deprecated `#filter` method for filter objects, use the corresponding * Remove deprecated `#filter` method for filter objects, use the corresponding
method instead (e.g. `#before` for a before filter). method instead (e.g. `#before` for a before filter).
* Removed 'cow' => 'kine' irregular inflection from default
inflections. ([Commit](https://github.com/rails/rails/commit/c300dca9963bda78b8f358dbcb59cabcdc5e1dc9))
### Deprecations ### Deprecations
* Deprecated `Numeric#{ago,until,since,from_now}`, the user is expected to * Deprecated `Numeric#{ago,until,since,from_now}`, the user is expected to
@ -591,6 +642,9 @@ for detailed changes.
([Pull Request](https://github.com/rails/rails/pull/13060) / ([Pull Request](https://github.com/rails/rails/pull/13060) /
[More Details](upgrading_ruby_on_rails.html#changes-in-json-handling)) [More Details](upgrading_ruby_on_rails.html#changes-in-json-handling))
* Deprecate custom `BigDecimal`
serialization. ([Pull Request](https://github.com/rails/rails/pull/13911))
### Notable changes ### Notable changes
* `ActiveSupport`'s JSON encoder has been rewritten to take advantage of the * `ActiveSupport`'s JSON encoder has been rewritten to take advantage of the
@ -620,11 +674,30 @@ for detailed changes.
`at_middle_of_day` as `at_middle_of_day` as
aliases. ([Pull Request](https://github.com/rails/rails/pull/10879)) aliases. ([Pull Request](https://github.com/rails/rails/pull/10879))
* Added `Date#all_week/month/quarter/year` for generating date
ranges. ([Pull Request](https://github.com/rails/rails/pull/9685))
* Added `Time.zone.yesterday` and
`Time.zone.tomorrow`. ([Pull Request](https://github.com/rails/rails/pull/12822))
* Added `String#remove(pattern)` as a short-hand for the common pattern of * Added `String#remove(pattern)` as a short-hand for the common pattern of
`String#gsub(pattern,'')`. ([Commit](https://github.com/rails/rails/commit/5da23a3f921f0a4a3139495d2779ab0d3bd4cb5f)) `String#gsub(pattern,'')`. ([Commit](https://github.com/rails/rails/commit/5da23a3f921f0a4a3139495d2779ab0d3bd4cb5f))
* Removed 'cow' => 'kine' irregular inflection from default * Added `Hash#compact` and `Hash#compact!` for removing items with nil value
inflections. ([Commit](https://github.com/rails/rails/commit/c300dca9963bda78b8f358dbcb59cabcdc5e1dc9)) from hash. ([Pull Request](https://github.com/rails/rails/pull/13632))
* `blank?` and `present?` commit to return
singletons. ([Commit](https://github.com/rails/rails/commit/126dc47665c65cd129967cbd8a5926dddd0aa514))
* Default the new `I18n.enforce_available_locales` config to `true`, meaning
`I18n` will make sure that all locales passed to it must be declared in the
`available_locales`
list. ([Pull Request](https://github.com/rails/rails/commit/8e21ae37ad9fef6b7393a84f9b5f2e18a831e49a))
* Introduce Module#concerning: a natural, low-ceremony way to separate
responsibilities within a
class. ([Commit](https://github.com/rails/rails/commit/1eee0ca6de975b42524105a59e0521d18b38ab81))
Credits Credits
------- -------

View file

@ -1,6 +1,6 @@
* Added Thor-action for creation of migrations. * Added Thor-action for creation of migrations.
Fixes #13588 and #12674. Fixes #13588, #12674.
*Gert Goet* *Gert Goet*