Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
0715d8c3
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0715d8c3
编写于
11月 25, 2014
作者:
G
Godfrey Chan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rearrange release notes by importance [ci skip]
上级
83c52c04
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
85 addition
and
99 deletion
+85
-99
guides/source/4_2_release_notes.md
guides/source/4_2_release_notes.md
+85
-99
未找到文件。
guides/source/4_2_release_notes.md
浏览文件 @
0715d8c3
...
...
@@ -288,9 +288,6 @@ Please refer to the [Changelog][railties] for detailed changes.
### Deprecations
*
Deprecated
`Rails::Rack::LogTailer`
without replacement.
(
[
Commit
](
https://github.com/rails/rails/commit/84a13e019e93efaa8994b3f8303d635a7702dbce
)
)
*
Deprecated missing
`config.log_level`
for production environments.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16622
)
)
...
...
@@ -301,6 +298,9 @@ Please refer to the [Changelog][railties] for detailed changes.
*
Deprecated
`rake test:all:db`
in favor of
`rake test:db`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/17348
)
)
*
Deprecated
`Rails::Rack::LogTailer`
without replacement.
(
[
Commit
](
https://github.com/rails/rails/commit/84a13e019e93efaa8994b3f8303d635a7702dbce
)
)
### Notable changes
*
Introduced
`web-console`
in the default application Gemfile.
...
...
@@ -309,9 +309,6 @@ Please refer to the [Changelog][railties] for detailed changes.
*
Added a
`required`
option to the model generator for associations.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16062
)
)
*
Introduced an
`after_bundle`
callback for use in Rails templates.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16359
)
)
*
Introduced the
`x`
namespace for defining custom configuration options:
```ruby
...
...
@@ -365,6 +362,9 @@ Please refer to the [Changelog][railties] for detailed changes.
*
Introduced an API to register new extensions for
`rake notes`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14379
)
)
*
Introduced an
`after_bundle`
callback for use in Rails templates.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16359
)
)
*
Introduced
`Rails.gem_version`
as a convenience method to return
`Gem::Version.new(Rails.version)`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14101
)
)
...
...
@@ -421,18 +421,6 @@ Please refer to the [Changelog][action-pack] for detailed changes.
### Notable changes
*
Rails will now automatically include the template's digest in ETags.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16527
)
)
*
`render nothing: true`
or rendering a
`nil`
body no longer add a single
space padding to the response body.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14883
)
)
*
Introduced the
`always_permitted_parameters`
option to configure which
parameters are permitted globally. The default value of this configuration
is
`['controller', 'action']`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15933
)
)
*
The
`*_filter`
family methods have been removed from the documentation. Their
usage is discouraged in favor of the
`*_action`
family methods:
...
...
@@ -459,6 +447,22 @@ Please refer to the [Changelog][action-pack] for detailed changes.
(Commit [1](https://github.com/rails/rails/commit/6c5f43bab8206747a8591435b2aa0ff7051ad3de),
[2](https://github.com/rails/rails/commit/489a8f2a44dc9cea09154ee1ee2557d1f037c7d4))
*
`render nothing: true`
or rendering a
`nil`
body no longer add a single
space padding to the response body.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14883
)
)
*
Rails will now automatically include the template's digest in ETags.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16527
)
)
*
Segments that are passed into URL helpers are now automatically escaped.
(
[
Commit
](
https://github.com/rails/rails/commit/5460591f0226a9d248b7b4f89186bd5553e7768f
)
)
*
Introduced the
`always_permitted_parameters`
option to configure which
parameters are permitted globally. The default value of this configuration
is
`['controller', 'action']`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15933
)
)
*
Added HTTP method
`MKCALENDAR`
from RFC-4791
(
[
Pull Request
](
https://github.com/rails/rails/pull/15121
)
)
...
...
@@ -466,9 +470,6 @@ Please refer to the [Changelog][action-pack] for detailed changes.
and action name in the payload.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14137
)
)
*
Segments that are passed into URL helpers are now automatically escaped.
(
[
Commit
](
https://github.com/rails/rails/commit/5460591f0226a9d248b7b4f89186bd5553e7768f
)
)
*
Improved the Routing Error page with fuzzy matching for route search.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14619
)
)
...
...
@@ -483,19 +484,6 @@ Please refer to the [Changelog][action-pack] for detailed changes.
serving assets from your Rails server in production.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16466
)
)
*
The way
`assert_select`
works has changed; specifically a different library
is used to interpret CSS selectors, build the transient DOM that the
selectors are applied against, and to extract the data from that DOM. These
changes should only affect edge cases. Examples:
*
Values in attribute selectors may need to be quoted if they contain
non-alphanumeric characters.
*
DOMs built from HTML source containing invalid HTML with improperly
nested elements may differ.
*
If the data selected contains entities, the value selected for comparison
used to be raw (e.g.
`AT&T`
), and now is evaluated
(e.g.
`AT&T`
).
Action View
-------------
...
...
@@ -518,16 +506,16 @@ Please refer to the [Changelog][action-view] for detailed changes.
`render file: "foo/bar"`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16888
)
)
*
The form helpers no longer generate a
`<div>`
element with inline CSS around
the hidden fields.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14738
)
)
*
Introduced a
`#{partial_name}_iteration`
special local variable for use with
partials that are rendered with a collection. It provides access to the
current state of the iteration via the
`#index`
,
`#size`
,
`#first?`
and
`#last?`
methods.
(
[
Pull Request
](
https://github.com/rails/rails/pull/7698
)
)
*
The form helpers no longer generate a
`<div>`
element with inline CSS around
the hidden fields.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14738
)
)
*
Placeholder I18n follows the same convention as
`label`
I18n.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16438
)
)
...
...
@@ -580,39 +568,15 @@ Please refer to the [Changelog][active-record] for detailed changes.
### Deprecations
*
Deprecated
`sanitize_sql_hash_for_conditions`
without replacement. Using a
`Relation`
for performing queries and updates is the prefered API.
(
[
Commit
](
https://github.com/rails/rails/commit/d5902c9e
)
)
*
Deprecated swallowing of errors inside
`after_commit`
and
`after_rollback`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16537
)
)
*
Deprecated calling
`DatabaseTasks.load_schema`
without a connection. Use
`DatabaseTasks.load_schema_current`
instead.
(
[
Commit
](
https://github.com/rails/rails/commit/f15cef67f75e4b52fd45655d7c6ab6b35623c608
)
)
*
Deprecated
`Reflection#source_macro`
without replacement as it is no longer
needed in Active Record.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16373
)
)
*
Deprecated broken support for automatic detection of counter caches on
`has_many :through`
associations. You should instead manually specify the
counter cache on the
`has_many`
and
`belongs_to`
associations for the
through records.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15754
)
)
*
Deprecated
`serialized_attributes`
without replacement.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15704
)
)
*
Deprecated returning
`nil`
from
`column_for_attribute`
when no column
exists. It will return a null object in Rails 5.0.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15878
)
)
*
Deprecated using
`.joins`
,
`.preload`
and
`.eager_load`
with associations
that depends on the instance state (i.e. those defined with a scope that
takes an argument) without replacement.
(
[
Commit
](
https://github.com/rails/rails/commit/ed56e596a0467390011bc9d56d462539776adac1
)
)
*
Deprecated passing Active Record objects to
`.find`
or
`.exists?`
. Call
`#id`
on the objects first.
(Commit
[
1
](
https://github.com/rails/rails/commit/d92ae6ccca3bcfd73546d612efaea011270bd270
)
,
...
...
@@ -630,34 +594,35 @@ Please refer to the [Changelog][active-record] for detailed changes.
([Commit](https://github.com/rails/rails/commit/91949e48cf41af9f3e4ffba3e5eecf9b0a08bfc3))
### Notable changes
*
Deprecated calling
`DatabaseTasks.load_schema`
without a connection. Use
`DatabaseTasks.load_schema_current`
instead.
(
[
Commit
](
https://github.com/rails/rails/commit/f15cef67f75e4b52fd45655d7c6ab6b35623c608
)
)
*
`ActiveRecord::Base#reflections`
now returns a hash with
`String`
keys instead of
`Symbol`
keys.
(
[
Pull Request
](
https://github.com/rails/rails/pull/17718
)
)
*
Deprecated
`sanitize_sql_hash_for_conditions`
without replacement. Using a
`Relation`
for performing queries and updates is the prefered API.
(
[
Commit
](
https://github.com/rails/rails/commit/d5902c9e
)
)
*
The PostgreSQL adapter now supports the
`JSONB`
datatype in PostgreSQL 9.4+.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16220
)
)
*
Deprecated
`Reflection#source_macro`
without replacement as it is no longer
needed in Active Record.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16373
)
)
*
The
`#references`
method in migrations now supports a
`type`
option for
specifying the type of the foreign key (e.g.
`:uuid`
).
(
[
Pull Request
](
https://github.com/rails/rails/pull/16231
)
)
*
Deprecated
`serialized_attributes`
without replacement.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15704
)
)
*
Added a
`:required`
option to singular associations, which defines a
presence validation on the association
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/1
6056
)
)
*
Deprecated returning
`nil`
from
`column_for_attribute`
when no column
exists. It will return a null object in Rails 5.0
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/1
5878
)
)
*
Introduced
`ActiveRecord::Base#validate!`
that raises
`RecordInvalid`
if the
record is invalid.
(
[
Pull Request
](
https://github.com/rails/rails/pull/8639
)
)
*
Deprecated using
`.joins`
,
`.preload`
and
`.eager_load`
with associations
that depends on the instance state (i.e. those defined with a scope that
takes an argument) without replacement.
(
[
Commit
](
https://github.com/rails/rails/commit/ed56e596a0467390011bc9d56d462539776adac1
)
)
*
`ActiveRecord::Base#reload`
now behaves the same as
`m = Model.find(m.id)`
,
meaning that it no longer retains the extra attributes from custom
`select`
s.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15866
)
)
### Notable changes
*
Introduced the
`bin/rake db:purge`
task to empty the database for the
current environment
.
(
[
Commit
](
https://github.com/rails/rails/commit/e2f232aba15937a4b9d14bd91e0392c6d55be58d
)
)
*
Added a
`:required`
option to singular associations, which defines a
presence validation on the association
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16056
)
)
*
`ActiveRecord::Dirty`
now detects in-place changes to mutable values.
Serialized attributes on Active Record models will no longer save when
...
...
@@ -667,35 +632,57 @@ Please refer to the [Changelog][active-record] for detailed changes.
[
2
](
https://github.com/rails/rails/pull/15786
)
,
[
3
](
https://github.com/rails/rails/pull/15788
)
)
*
Added support for
`#pretty_print`
in
`ActiveRecord::Base`
objects.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15172
)
)
*
Introduced the
`bin/rake db:purge`
task to empty the database for the
current environment.
(
[
Commit
](
https://github.com/rails/rails/commit/e2f232aba15937a4b9d14bd91e0392c6d55be58d
)
)
*
Introduced
`ActiveRecord::Base#validate!`
that raises
`RecordInvalid`
if the
record is invalid.
(
[
Pull Request
](
https://github.com/rails/rails/pull/8639
)
)
*
Introduced
`#validate`
as an alias for
`#valid?`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14456
)
)
*
`#touch`
now accepts multiple attributes to be touched at once.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14423
)
)
*
The PostgreSQL adapter now supports the
`JSONB`
datatype in PostgreSQL 9.4+.
(
[
Pull Request
](
https://github.com/rails/rails/pull/16220
)
)
*
PostgreSQL and SQLite adapters no longer add a default limit of 255
characters on string columns.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14579
)
)
*
Added support for the
`citext`
column type in PostgreSQL adapter.
(
[
Pull Request
](
https://github.com/rails/rails/pull/12523
)
)
*
Added support for user-created range types in PostgreSQL adapter.
(
[
Commit
](
https://github.com/rails/rails/commit/4cb47167e747e8f9dc12b0ddaf82bdb68c03e032
)
)
*
`sqlite3:///some/path`
now resolves to the absolute system path
`/some/path`
. For relative paths, use
`sqlite3:some/path`
instead.
(Previously,
`sqlite3:///some/path`
resolved to the relative path
`some/path`
. This behaviour was deprecated on Rails 4.1).
(
[
Pull Request
](
https://github.com/rails/rails/pull/14569
)
)
*
Introduced
`#validate`
as an alias for
`#valid?`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14456
)
)
*
`#touch`
now accepts multiple attributes to be touched at once.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14423
)
)
*
Added support for fractional seconds for MySQL 5.6 and above.
(Pull Request
[
1
](
https://github.com/rails/rails/pull/8240
)
,
[
2
](
https://github.com/rails/rails/pull/14359
)
)
*
Added support for
the
`citext`
column type in PostgreSQL adapter
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/1
2523
)
)
*
Added support for
`#pretty_print`
in
`ActiveRecord::Base`
objects
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/1
5172
)
)
*
Added support for user-created range types in PostgreSQL adapter.
(
[
Commit
](
https://github.com/rails/rails/commit/4cb47167e747e8f9dc12b0ddaf82bdb68c03e032
)
)
*
`ActiveRecord::Base#reload`
now behaves the same as
`m = Model.find(m.id)`
,
meaning that it no longer retains the extra attributes from custom
`select`
s.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15866
)
)
*
`ActiveRecord::Base#reflections`
now returns a hash with
`String`
keys instead of
`Symbol`
keys.
(
[
Pull Request
](
https://github.com/rails/rails/pull/17718
)
)
*
The
`#references`
method in migrations now supports a
`type`
option for
specifying the type of the foreign key (e.g.
`:uuid`
).
(
[
Pull Request
](
https://github.com/rails/rails/pull/16231
)
)
Active Model
------------
...
...
@@ -718,6 +705,9 @@ Please refer to the [Changelog][active-model] for detailed changes.
### Notable changes
*
Introduced
`#validate`
as an alias for
`#valid?`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14456
)
)
*
Introduced the
`restore_attributes`
method in
`ActiveModel::Dirty`
to restore
the changed (dirty) attributes to their previous values.
(Pull Request
[
1
](
https://github.com/rails/rails/pull/14861
)
,
...
...
@@ -731,10 +721,6 @@ Please refer to the [Changelog][active-model] for detailed changes.
characters if validations are enabled.
(
[
Pull Request
](
https://github.com/rails/rails/pull/15708
)
)
*
Introduced
`#validate`
as an alias for
`#valid?`
.
(
[
Pull Request
](
https://github.com/rails/rails/pull/14456
)
)
Active Support
--------------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录