@@ -47,7 +47,8 @@ the object itself. The new [Global ID](https://github.com/rails/globalid)
47
47
library builds URIs and looks up the objects they reference. Passing Active
48
48
Record objects as job arguments just works by using Global ID internally.
49
49
50
- For example, if ` trashable ` is an AR this job runs just fine
50
+ For example, if ` trashable ` is an Active Record object, then this job runs
51
+ just fine with no serialization involved:
51
52
52
53
``` ruby
53
54
class TrashableCleanupJob < ActiveJob ::Base
@@ -57,8 +58,6 @@ class TrashableCleanupJob < ActiveJob::Base
57
58
end
58
59
```
59
60
60
- with no serialization involved.
61
-
62
61
See the [ Active Job Basics] ( active_job_basics.html ) guide for more
63
62
information.
64
63
@@ -80,9 +79,9 @@ on similar calls, skipping most of the query-generation work on subsequent
80
79
calls. For more details, please refer to [ Aaron Patterson's blog
81
80
post] ( http://tenderlovemaking.com/2014/02/19/adequaterecord-pro-like-activerecord.html ) .
82
81
83
- Active Record will automatically take advantage of this feature on the
82
+ Active Record will automatically take advantage of this feature on
84
83
supported operations without any user involvement or code changes. Here are
85
- some examples of the supported operations:
84
+ some examples of supported operations:
86
85
87
86
``` ruby
88
87
Post .find(1 ) # First call generates and cache the prepared statement
@@ -96,10 +95,10 @@ post.comments(true)
96
95
```
97
96
98
97
It's important to highlight that, as the examples above suggest, the prepared
99
- statements do not cache the values passed in the method calls, they rather
98
+ statements do not cache the values passed in the method calls; rather , they
100
99
have placeholders for them.
101
100
102
- The caching is not used in the following scenarios:
101
+ Caching is not used in the following scenarios:
103
102
104
103
- The model has a default scope
105
104
- The model uses single table inheritance
@@ -119,7 +118,7 @@ The caching is not used in the following scenarios:
119
118
120
119
### Web Console
121
120
122
- New applications generated from Rails 4.2 now come with the [ Web
121
+ New applications generated with Rails 4.2 now come with the [ Web
123
122
Console] ( https://github.com/rails/web-console ) gem by default. Web Console adds
124
123
an interactive Ruby console on every error page and provides a ` console ` view
125
124
and controller helpers.
@@ -167,9 +166,9 @@ The following changes may require immediate action upon upgrade.
167
166
### ` render ` with a String Argument
168
167
169
168
Previously, calling ` render "foo/bar" ` in a controller action was equivalent to
170
- ` render file: "foo/bar" ` . In Rails 4.2, this has been changed to mean ` render template: "foo/bar" `
171
- instead. If you need to render a file, please change your code to use the
172
- explicit form (` render file: "foo/bar" ` ) instead.
169
+ ` render file: "foo/bar" ` . In Rails 4.2, this has been changed to mean
170
+ ` render template: "foo/bar" ` instead. If you need to render a file, please
171
+ change your code to use the explicit form (` render file: "foo/bar" ` ) instead.
173
172
174
173
### ` respond_with ` / Class-Level ` respond_to `
175
174
210
209
211
210
Due to a [ change in Rack] ( https://github.com/rack/rack/commit/28b014484a8ac0bbb388e7eaeeef159598ec64fc ) ,
212
211
` rails server ` now listens on ` localhost ` instead of ` 0.0.0.0 ` by default. This
213
- should have minimal impact on the standard development workflow as both http://127.0.0.1:3000
214
- and http://localhost:3000 will continue to work as before on your own machine.
212
+ should have minimal impact on the standard development workflow as both
213
+ http://127.0.0.1:3000 and http://localhost:3000 will continue to work as before
214
+ on your own machine.
215
215
216
216
However, with this change you will no longer be able to access the Rails
217
217
server from a different machine, for example if your development environment
@@ -229,8 +229,8 @@ built upon [Loofah](https://github.com/flavorjones/loofah) and
229
229
[ Nokogiri] ( https://github.com/sparklemotion/nokogiri ) . The new sanitizer is
230
230
more secure and its sanitization is more powerful and flexible.
231
231
232
- Due to the new algorithm, sanitized output changes for certain pathological
233
- inputs.
232
+ Due to the new algorithm, the sanitized output may be different for certain
233
+ pathological inputs.
234
234
235
235
If you have a particular need for the exact output of the old sanitizer, you
236
236
can add the [ rails-deprecated_sanitizer] ( https://github.com/kaspth/rails-deprecated_sanitizer )
@@ -663,8 +663,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
663
663
current environment.
664
664
([Commit](https://github.com/rails/rails/commit/e2f232aba15937a4b9d14bd91e0392c6d55be58d))
665
665
666
- * Introduced `ActiveRecord::Base#validate!` that raises `ActiveRecord::RecordInvalid` if the
667
- record is invalid.
666
+ * Introduced `ActiveRecord::Base#validate!` that raises
667
+ `ActiveRecord::RecordInvalid` if the record is invalid.
668
668
([Pull Request](https://github.com/rails/rails/pull/8639))
669
669
670
670
* Introduced `validate` as an alias for `valid?`.
@@ -704,8 +704,8 @@ Please refer to the [Changelog][active-record] for detailed changes.
704
704
`SELECT`s.
705
705
([Pull Request](https://github.com/rails/rails/pull/15866))
706
706
707
- * `ActiveRecord::Base#reflections` now returns a hash with string keys instead of symbol keys.
708
- ([Pull Request](https://github.com/rails/rails/pull/17718))
707
+ * `ActiveRecord::Base#reflections` now returns a hash with string keys instead
708
+ of symbol keys. ([Pull Request](https://github.com/rails/rails/pull/17718))
709
709
710
710
* The `references` method in migrations now supports a `type` option for
711
711
specifying the type of the foreign key (e.g. `:uuid`).
0 commit comments