rails 4.2.0.beta1 → 4.2.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/guides/rails_guides/markdown.rb +6 -1
- data/guides/source/2_2_release_notes.md +1 -1
- data/guides/source/2_3_release_notes.md +1 -1
- data/guides/source/3_0_release_notes.md +2 -2
- data/guides/source/3_1_release_notes.md +4 -1
- data/guides/source/3_2_release_notes.md +4 -1
- data/guides/source/4_0_release_notes.md +4 -1
- data/guides/source/4_1_release_notes.md +4 -4
- data/guides/source/4_2_release_notes.md +272 -45
- data/guides/source/action_controller_overview.md +3 -3
- data/guides/source/action_mailer_basics.md +28 -4
- data/guides/source/action_view_overview.md +11 -11
- data/guides/source/active_job_basics.md +99 -63
- data/guides/source/active_record_postgresql.md +2 -1
- data/guides/source/active_record_querying.md +7 -9
- data/guides/source/active_support_core_extensions.md +48 -2
- data/guides/source/asset_pipeline.md +200 -18
- data/guides/source/association_basics.md +8 -8
- data/guides/source/caching_with_rails.md +1 -1
- data/guides/source/command_line.md +1 -1
- data/guides/source/configuring.md +7 -7
- data/guides/source/contributing_to_ruby_on_rails.md +17 -0
- data/guides/source/debugging_rails_applications.md +2 -2
- data/guides/source/development_dependencies_install.md +41 -43
- data/guides/source/form_helpers.md +17 -17
- data/guides/source/generators.md +6 -2
- data/guides/source/getting_started.md +1 -1
- data/guides/source/i18n.md +16 -0
- data/guides/source/initialization.md +0 -2
- data/guides/source/layouts_and_rendering.md +2 -1
- data/guides/source/maintenance_policy.md +6 -3
- data/guides/source/nested_model_forms.md +4 -1
- data/guides/source/routing.md +1 -1
- data/guides/source/testing.md +2 -2
- data/guides/source/upgrading_ruby_on_rails.md +94 -23
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6774b8036507c4d7216e995717a5ff4bc53c8b0e
|
4
|
+
data.tar.gz: cb66bce252936966e74719c4e24f275d9f0f4ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6827af3eea8f6f45615ed28bd97334927179180f46fc0c7a31ba97c2cfec643ec5eb01c1eae87dc6d9a55a0c182ae8572b301274039af050298b09c104361fd8
|
7
|
+
data.tar.gz: 067619d275d9e8e55644c745e181c5f4a995a68b1364870dc3140dd79a6458108dc09da6066bcdbc1cda738767c2b63fc5a009620806a2bfe9db38e99ebe52c0
|
@@ -47,7 +47,12 @@ module RailsGuides
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def dom_id_text(text)
|
50
|
-
|
50
|
+
escaped_chars = Regexp.escape('\\/`*_{}[]()#+-.!:,;|&<>^~=\'"')
|
51
|
+
|
52
|
+
text.downcase.gsub(/\?/, '-questionmark')
|
53
|
+
.gsub(/!/, '-bang')
|
54
|
+
.gsub(/[#{escaped_chars}]+/, ' ').strip
|
55
|
+
.gsub(/\s+/, '-')
|
51
56
|
end
|
52
57
|
|
53
58
|
def engine
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Ruby on Rails 2.2 Release Notes
|
2
2
|
===============================
|
3
3
|
|
4
|
-
Rails 2.2 delivers a number of new and improved features. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/
|
4
|
+
Rails 2.2 delivers a number of new and improved features. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/2-2-stable) in the main Rails repository on GitHub.
|
5
5
|
|
6
6
|
Along with Rails, 2.2 marks the launch of the [Ruby on Rails Guides](http://guides.rubyonrails.org/), the first results of the ongoing [Rails Guides hackfest](http://hackfest.rubyonrails.org/guide). This site will deliver high-quality documentation of the major features of Rails.
|
7
7
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Ruby on Rails 2.3 Release Notes
|
2
2
|
===============================
|
3
3
|
|
4
|
-
Rails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering, more efficient routing, application templates, and quiet backtraces. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/
|
4
|
+
Rails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering, more efficient routing, application templates, and quiet backtraces. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/2-3-stable) in the main Rails repository on GitHub or review the `CHANGELOG` files for the individual Rails components.
|
5
5
|
|
6
6
|
--------------------------------------------------------------------------------
|
7
7
|
|
@@ -15,7 +15,7 @@ Even if you don't give a hoot about any of our internal cleanups, Rails 3.0 is g
|
|
15
15
|
|
16
16
|
On top of all that, we've tried our best to deprecate the old APIs with nice warnings. That means that you can move your existing application to Rails 3 without immediately rewriting all your old code to the latest best practices.
|
17
17
|
|
18
|
-
These release notes cover the major upgrades, but don't include every little bug fix and change. Rails 3.0 consists of almost 4,000 commits by more than 250 authors! If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/
|
18
|
+
These release notes cover the major upgrades, but don't include every little bug fix and change. Rails 3.0 consists of almost 4,000 commits by more than 250 authors! If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/3-0-stable) in the main Rails repository on GitHub.
|
19
19
|
|
20
20
|
--------------------------------------------------------------------------------
|
21
21
|
|
@@ -545,7 +545,7 @@ These are the main changes in Active Support:
|
|
545
545
|
* `String#to_time` and `String#to_datetime` handle fractional seconds.
|
546
546
|
* Added support to new callbacks for around filter object that respond to `:before` and `:after` used in before and after callbacks.
|
547
547
|
* The `ActiveSupport::OrderedHash#to_a` method returns an ordered set of arrays. Matches Ruby 1.9's `Hash#to_a`.
|
548
|
-
* `MissingSourceFile` exists as a constant but it is now just
|
548
|
+
* `MissingSourceFile` exists as a constant but it is now just equal to `LoadError`.
|
549
549
|
* Added `Class#class_attribute`, to be able to declare a class-level attribute whose value is inheritable and overwritable by subclasses.
|
550
550
|
* Finally removed `DeprecatedCallbacks` in `ActiveRecord::Associations`.
|
551
551
|
* `Object#metaclass` is now `Kernel#singleton_class` to match Ruby.
|
@@ -8,7 +8,10 @@ Highlights in Rails 3.1:
|
|
8
8
|
* Assets Pipeline
|
9
9
|
* jQuery as the default JavaScript library
|
10
10
|
|
11
|
-
|
11
|
+
These release notes cover only the major changes. To learn about various bug
|
12
|
+
fixes and changes, please refer to the change logs or check out the [list of
|
13
|
+
commits](https://github.com/rails/rails/commits/3-1-stable) in the main Rails
|
14
|
+
repository on GitHub.
|
12
15
|
|
13
16
|
--------------------------------------------------------------------------------
|
14
17
|
|
@@ -8,7 +8,10 @@ Highlights in Rails 3.2:
|
|
8
8
|
* Automatic Query Explains
|
9
9
|
* Tagged Logging
|
10
10
|
|
11
|
-
These release notes cover the major changes
|
11
|
+
These release notes cover only the major changes. To learn about various bug
|
12
|
+
fixes and changes, please refer to the change logs or check out the [list of
|
13
|
+
commits](https://github.com/rails/rails/commits/3-2-stable) in the main Rails
|
14
|
+
repository on GitHub.
|
12
15
|
|
13
16
|
--------------------------------------------------------------------------------
|
14
17
|
|
@@ -8,7 +8,10 @@ Highlights in Rails 4.0:
|
|
8
8
|
* Turbolinks
|
9
9
|
* Russian Doll Caching
|
10
10
|
|
11
|
-
These release notes cover only the major changes. To
|
11
|
+
These release notes cover only the major changes. To learn about various bug
|
12
|
+
fixes and changes, please refer to the change logs or check out the [list of
|
13
|
+
commits](https://github.com/rails/rails/commits/4-0-stable) in the main Rails
|
14
|
+
repository on GitHub.
|
12
15
|
|
13
16
|
--------------------------------------------------------------------------------
|
14
17
|
|
@@ -8,10 +8,10 @@ Highlights in Rails 4.1:
|
|
8
8
|
* Action Pack variants
|
9
9
|
* Action Mailer previews
|
10
10
|
|
11
|
-
These release notes cover only the major changes. To
|
12
|
-
fixes and changes, please refer to the change logs or check out the
|
13
|
-
|
14
|
-
|
11
|
+
These release notes cover only the major changes. To learn about various bug
|
12
|
+
fixes and changes, please refer to the change logs or check out the [list of
|
13
|
+
commits](https://github.com/rails/rails/commits/4-1-stable) in the main Rails
|
14
|
+
repository on GitHub.
|
15
15
|
|
16
16
|
--------------------------------------------------------------------------------
|
17
17
|
|
@@ -8,10 +8,10 @@ Highlights in Rails 4.2:
|
|
8
8
|
* Web Console
|
9
9
|
* Foreign key support
|
10
10
|
|
11
|
-
These release notes cover only the major changes. To
|
12
|
-
fixes and changes, please refer to the change logs or check out the
|
13
|
-
|
14
|
-
|
11
|
+
These release notes cover only the major changes. To learn about various bug
|
12
|
+
fixes and changes, please refer to the change logs or check out the [list of
|
13
|
+
commits](https://github.com/rails/rails/commits/master) in the main Rails
|
14
|
+
repository on GitHub.
|
15
15
|
|
16
16
|
--------------------------------------------------------------------------------
|
17
17
|
|
@@ -25,9 +25,8 @@ If you're upgrading an existing application, it's a great idea to have good test
|
|
25
25
|
coverage before going in. You should also first upgrade to Rails 4.1 in case you
|
26
26
|
haven't and make sure your application still runs as expected before attempting
|
27
27
|
to upgrade to Rails 4.2. A list of things to watch out for when upgrading is
|
28
|
-
available in the
|
29
|
-
|
30
|
-
guide.
|
28
|
+
available in the guide: [Upgrading Ruby on
|
29
|
+
Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-4-1-to-rails-4-2)
|
31
30
|
|
32
31
|
|
33
32
|
Major Features
|
@@ -36,11 +35,14 @@ Major Features
|
|
36
35
|
### Active Job, Action Mailer #deliver_later
|
37
36
|
|
38
37
|
Active Job is a new framework in Rails 4.2. It is an adapter layer on top of
|
39
|
-
queuing systems like Resque, Delayed
|
40
|
-
|
41
|
-
|
38
|
+
queuing systems like [Resque](https://github.com/resque/resque), [Delayed
|
39
|
+
Job](https://github.com/collectiveidea/delayed_job),
|
40
|
+
[Sidekiq](https://github.com/mperham/sidekiq), and more.
|
42
41
|
|
43
|
-
|
42
|
+
You can write your jobs with the Active Job API, and it'll run on all these
|
43
|
+
queues with no changes (it comes pre-configured with an inline runner).
|
44
|
+
|
45
|
+
Building on top of Active Job, Action Mailer now comes with a `#deliver_later`
|
44
46
|
method, which adds your email to be sent as a job to a queue, so it doesn't
|
45
47
|
bog down the controller or model.
|
46
48
|
|
@@ -52,21 +54,65 @@ deserialize it at run time.
|
|
52
54
|
|
53
55
|
### Adequate Record
|
54
56
|
|
55
|
-
|
56
|
-
|
57
|
-
|
57
|
+
Adequate Record is a set of refactorings that make Active Record `find` and
|
58
|
+
`find_by` methods and some association queries upto 2x faster.
|
59
|
+
|
60
|
+
It works by caching SQL query patterns while executing the Active Record calls.
|
61
|
+
The cache helps skip parts of the computation involved in the transformation of
|
62
|
+
the calls into SQL queries. More details in [Aaron Patterson's
|
63
|
+
post](http://tenderlovemaking.com/2014/02/19/adequaterecord-pro-like-activerecord.html).
|
64
|
+
|
65
|
+
Nothing special has to be done to activate this feature. Most `find` and
|
66
|
+
`find_by` calls and association queries will use it automatically. Examples:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
Post.find 1 # caches query pattern
|
70
|
+
Post.find 2 # uses the cached pattern
|
71
|
+
|
72
|
+
Post.find_by_title 'first post' # caches query pattern
|
73
|
+
Post.find_by_title 'second post' # uses the cached pattern
|
74
|
+
|
75
|
+
post.comments # caches query pattern
|
76
|
+
post.comments(true) # uses cached pattern
|
77
|
+
```
|
78
|
+
|
79
|
+
The caching is not used in the following scenarios:
|
80
|
+
|
81
|
+
- The model has a default scope
|
82
|
+
- The model uses single table inheritence to inherit from another model
|
83
|
+
- `find` with a list of ids. eg:
|
58
84
|
|
59
|
-
|
85
|
+
```ruby
|
86
|
+
Post.find(1,2,3)
|
87
|
+
OR
|
88
|
+
Post.find [1,2]
|
89
|
+
```
|
90
|
+
|
91
|
+
- `find_by` with sql fragments:
|
92
|
+
|
93
|
+
```ruby
|
94
|
+
Post.find_by "published_at < ?", 2.weeks.ago
|
95
|
+
```
|
60
96
|
|
61
97
|
### Web Console
|
62
98
|
|
63
|
-
New applications generated from Rails 4.2 now
|
99
|
+
New applications generated from Rails 4.2 now come with the Web Console gem by
|
64
100
|
default.
|
65
101
|
|
66
|
-
Web Console is
|
67
|
-
|
68
|
-
|
69
|
-
|
102
|
+
Web Console is a set of debugging tools for your Rails application. It will add
|
103
|
+
an interactive console on every error page, a `console` view helper and a VT100
|
104
|
+
compatible terminal.
|
105
|
+
|
106
|
+
The interactive console on the error pages lets you execute code where the
|
107
|
+
exception originated. It's quite handy to introspect the state that led to the
|
108
|
+
error.
|
109
|
+
|
110
|
+
The `console` view helper launches an interactive console within the context of
|
111
|
+
the view where it is invoked.
|
112
|
+
|
113
|
+
Finally, you can launch a VT100 terminal that runs `rails console`. If you need
|
114
|
+
to create or modify existing test data, you can do that straight from the
|
115
|
+
browser.
|
70
116
|
|
71
117
|
### Foreign key support
|
72
118
|
|
@@ -95,6 +141,158 @@ and
|
|
95
141
|
for a full description.
|
96
142
|
|
97
143
|
|
144
|
+
Incompatibilities
|
145
|
+
-----------------
|
146
|
+
|
147
|
+
Previously deprecated functionality has been removed. Please refer to the
|
148
|
+
individual components for new deprecations in this release.
|
149
|
+
|
150
|
+
The following changes may require immediate action upon upgrade.
|
151
|
+
|
152
|
+
### `render` with a String argument
|
153
|
+
|
154
|
+
Previously, calling `render "foo/bar"` in a controller action is equivalent to
|
155
|
+
`render file: "foo/bar"`. In Rails 4.2, this has been changed to mean `render template: "foo/bar"`
|
156
|
+
instead. If you need to render a file, please change your code to use the
|
157
|
+
explicit form (`render file: "foo/bar"`) instead.
|
158
|
+
|
159
|
+
### `respond_with` / class-level `respond_to`
|
160
|
+
|
161
|
+
`respond_with` and the corresponding class-level `respond_to` have been moved to
|
162
|
+
the `responders` gem. To use the following, add `gem 'responders', '~> 2.0'` to
|
163
|
+
your Gemfile:
|
164
|
+
|
165
|
+
```ruby
|
166
|
+
# app/controllers/users_controller.rb
|
167
|
+
|
168
|
+
class UsersController < ApplicationController
|
169
|
+
respond_to :html, :json
|
170
|
+
|
171
|
+
def show
|
172
|
+
@user = User.find(params[:id])
|
173
|
+
respond_with @user
|
174
|
+
end
|
175
|
+
end
|
176
|
+
```
|
177
|
+
|
178
|
+
Instance-level `respond_to` is unaffected:
|
179
|
+
|
180
|
+
```ruby
|
181
|
+
# app/controllers/users_controller.rb
|
182
|
+
|
183
|
+
class UsersController < ApplicationController
|
184
|
+
def show
|
185
|
+
@user = User.find(params[:id])
|
186
|
+
respond_to do |format|
|
187
|
+
format.html
|
188
|
+
format.json { render json: @user }
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
```
|
193
|
+
|
194
|
+
### Default host for `rails server`
|
195
|
+
|
196
|
+
Due to a [change in Rack](https://github.com/rack/rack/commit/28b014484a8ac0bbb388e7eaeeef159598ec64fc),
|
197
|
+
`rails server` now listens on `localhost` instead of `0.0.0.0` by default. This
|
198
|
+
should have minimal impact on the standard development workflow as both http://127.0.0.1:3000
|
199
|
+
and http://localhost:3000 would continue to work as before on your own machine.
|
200
|
+
|
201
|
+
However, with this change you would no longer be able to access the Rails server
|
202
|
+
from a different machine (e.g. your development environment is in a virtual
|
203
|
+
machine and you would like to access it from the host machine), you would need
|
204
|
+
to start the server with `rails server -b 0.0.0.0` to restore the old behavior.
|
205
|
+
|
206
|
+
If you do this, be sure to configure your firewall properly such that only
|
207
|
+
trusted machines on your network can access your development server.
|
208
|
+
|
209
|
+
### Production logging
|
210
|
+
|
211
|
+
The default log level in the `production` environment is now `:debug`. This
|
212
|
+
makes it consistent with the other environments, and ensures plenty of
|
213
|
+
information is available to diagnose problems.
|
214
|
+
|
215
|
+
It can be returned to the previous level, `:info`, in the environment
|
216
|
+
configuration:
|
217
|
+
|
218
|
+
```ruby
|
219
|
+
# config/environments/production.rb
|
220
|
+
|
221
|
+
# Decrease the log volume.
|
222
|
+
config.log_level = :info
|
223
|
+
```
|
224
|
+
|
225
|
+
### HTML Sanitizer
|
226
|
+
|
227
|
+
The HTML sanitizer has been replaced with a new, more robust, implementation
|
228
|
+
built upon Loofah and Nokogiri. The new sanitizer is more secure and its
|
229
|
+
sanitization is more powerful and flexible.
|
230
|
+
|
231
|
+
With a new sanitization algorithm, the sanitized output will change for certain
|
232
|
+
pathological inputs.
|
233
|
+
|
234
|
+
If you have particular need for the exact output of the old sanitizer, you can
|
235
|
+
add `rails-deprecated_sanitizer` to your Gemfile, and it will automatically
|
236
|
+
replace the new implementation. Because it is opt-in, the legacy gem will not
|
237
|
+
give deprecation warnings.
|
238
|
+
|
239
|
+
`rails-deprecated_sanitizer` will be supported for Rails 4.2 only; it will not
|
240
|
+
be maintained for Rails 5.0.
|
241
|
+
|
242
|
+
See [the blog post](http://blog.plataformatec.com.br/2014/07/the-new-html-sanitizer-in-rails-4-2/)
|
243
|
+
for more detail on the changes in the new sanitizer.
|
244
|
+
|
245
|
+
### `assert_select`
|
246
|
+
|
247
|
+
`assert_select` is now based on Nokogiri, making it (TODO: betterer).
|
248
|
+
|
249
|
+
As a result, some previously-valid selectors are now unsupported. If your
|
250
|
+
application is using any of these spellings, you will need to update them:
|
251
|
+
|
252
|
+
* Values in attribute selectors may need to be quoted if they contain
|
253
|
+
non-alphanumeric characters.
|
254
|
+
|
255
|
+
```
|
256
|
+
a[href=/] => a[href="/"]
|
257
|
+
a[href$=/] => a[href$="/"]
|
258
|
+
```
|
259
|
+
|
260
|
+
* DOMs built from HTML source containing invalid HTML with improperly
|
261
|
+
nested elements may differ.
|
262
|
+
|
263
|
+
For example:
|
264
|
+
|
265
|
+
``` ruby
|
266
|
+
# content: <div><i><p></i></div>
|
267
|
+
|
268
|
+
# before:
|
269
|
+
assert_select('div > i') # => true
|
270
|
+
assert_select('div > p') # => false
|
271
|
+
assert_select('i > p') # => true
|
272
|
+
|
273
|
+
# now:
|
274
|
+
assert_select('div > i') # => true
|
275
|
+
assert_select('div > p') # => true
|
276
|
+
assert_select('i > p') # => false
|
277
|
+
```
|
278
|
+
|
279
|
+
* If the data selected contains entities, the value selected for comparison
|
280
|
+
used to be raw (e.g. `AT&T`), and now is evaluated
|
281
|
+
(e.g. `AT&T`).
|
282
|
+
|
283
|
+
``` ruby
|
284
|
+
# content: <p>AT&T</p>
|
285
|
+
|
286
|
+
# before:
|
287
|
+
assert_select('p', 'AT&T') # => true
|
288
|
+
assert_select('p', 'AT&T') # => false
|
289
|
+
|
290
|
+
# now:
|
291
|
+
assert_select('p', 'AT&T') # => true
|
292
|
+
assert_select('p', 'AT&T') # => false
|
293
|
+
```
|
294
|
+
|
295
|
+
|
98
296
|
Railties
|
99
297
|
--------
|
100
298
|
|
@@ -113,7 +311,7 @@ Please refer to the [Changelog][railties] for detailed changes.
|
|
113
311
|
### Notable changes
|
114
312
|
|
115
313
|
* Introduced `web-console` in the default application Gemfile.
|
116
|
-
([Pull Request](https://github.com/rails/rails/pull/
|
314
|
+
([Pull Request](https://github.com/rails/rails/pull/11667))
|
117
315
|
|
118
316
|
* Added a `required` option to the model generator for associations.
|
119
317
|
([Pull Request](https://github.com/rails/rails/pull/16062))
|
@@ -153,7 +351,7 @@ Please refer to the [Changelog][railties] for detailed changes.
|
|
153
351
|
namespace: my_app_development
|
154
352
|
|
155
353
|
# config/production.rb
|
156
|
-
|
354
|
+
Rails.application.configure do
|
157
355
|
config.middleware.use ExceptionNotifier, config_for(:exception_notification)
|
158
356
|
end
|
159
357
|
```
|
@@ -161,7 +359,7 @@ Please refer to the [Changelog][railties] for detailed changes.
|
|
161
359
|
([Pull Request](https://github.com/rails/rails/pull/16129))
|
162
360
|
|
163
361
|
* Introduced a `--skip-gems` option in the app generator to skip gems such as
|
164
|
-
`turbolinks` and `coffee-rails` that
|
362
|
+
`turbolinks` and `coffee-rails` that do not have their own specific flags.
|
165
363
|
([Commit](https://github.com/rails/rails/commit/10565895805887d4faf004a6f71219da177f78b7))
|
166
364
|
|
167
365
|
* Introduced a `bin/setup` script to enable automated setup code when
|
@@ -174,12 +372,10 @@ Please refer to the [Changelog][railties] for detailed changes.
|
|
174
372
|
* Introduced an API to register new extensions for `rake notes`.
|
175
373
|
([Pull Request](https://github.com/rails/rails/pull/14379))
|
176
374
|
|
177
|
-
* Introduced `Rails.gem_version` as a convenience method to return
|
375
|
+
* Introduced `Rails.gem_version` as a convenience method to return
|
376
|
+
`Gem::Version.new(Rails.version)`.
|
178
377
|
([Pull Request](https://github.com/rails/rails/pull/14101))
|
179
378
|
|
180
|
-
* Introduced an `after_bundle` callback in the Rails templates.
|
181
|
-
([Pull Request](https://github.com/rails/rails/pull/16359))
|
182
|
-
|
183
379
|
|
184
380
|
Action Pack
|
185
381
|
-----------
|
@@ -248,9 +444,9 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|
248
444
|
skip_filter => skip_action_callback
|
249
445
|
```
|
250
446
|
|
251
|
-
If your application
|
447
|
+
If your application currently depends on these methods, you should use the
|
252
448
|
replacement `*_action` methods instead. These methods will be deprecated in
|
253
|
-
the future and eventually removed from Rails.
|
449
|
+
the future and will eventually be removed from Rails.
|
254
450
|
|
255
451
|
(Commit [1](https://github.com/rails/rails/commit/6c5f43bab8206747a8591435b2aa0ff7051ad3de),
|
256
452
|
[2](https://github.com/rails/rails/commit/489a8f2a44dc9cea09154ee1ee2557d1f037c7d4))
|
@@ -258,8 +454,8 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|
258
454
|
* Added HTTP method `MKCALENDAR` from RFC-4791
|
259
455
|
([Pull Request](https://github.com/rails/rails/pull/15121))
|
260
456
|
|
261
|
-
* `*_fragment.action_controller` notifications now include the controller
|
262
|
-
in the payload.
|
457
|
+
* `*_fragment.action_controller` notifications now include the controller
|
458
|
+
and action name in the payload.
|
263
459
|
([Pull Request](https://github.com/rails/rails/pull/14137))
|
264
460
|
|
265
461
|
* Segments that are passed into URL helpers are now automatically escaped.
|
@@ -271,6 +467,26 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|
271
467
|
* Added an option to disable logging of CSRF failures.
|
272
468
|
([Pull Request](https://github.com/rails/rails/pull/14280))
|
273
469
|
|
470
|
+
* When the Rails server is set to serve static assets, gzip assets will now be
|
471
|
+
served if the client supports it and a pre-generated gzip file (.gz) is on disk.
|
472
|
+
By default the asset pipeline generates `.gz` files for all compressible assets.
|
473
|
+
Serving gzip files minimizes data transfer and speeds up asset requests. Always
|
474
|
+
[use a CDN](http://guides.rubyonrails.org/asset_pipeline.html#cdns) if you are
|
475
|
+
serving assets from your Rails server in production.
|
476
|
+
([Pull Request](https://github.com/rails/rails/pull/16466))
|
477
|
+
|
478
|
+
* The way `assert_select` works has changed; specifically a different library
|
479
|
+
is used to interpret css selectors, build the transient DOM that the
|
480
|
+
selectors are applied against, and to extract the data from that DOM. These
|
481
|
+
changes should only affect edge cases. Examples:
|
482
|
+
* Values in attribute selectors may need to be quoted if they contain
|
483
|
+
non-alphanumeric characters.
|
484
|
+
* DOMs built from HTML source containing invalid HTML with improperly
|
485
|
+
nested elements may differ.
|
486
|
+
* If the data selected contains entities, the value selected for comparison
|
487
|
+
used to be raw (e.g. `AT&T`), and now is evaluated
|
488
|
+
(e.g. `AT&T`).
|
489
|
+
|
274
490
|
|
275
491
|
Action View
|
276
492
|
-------------
|
@@ -290,6 +506,10 @@ Please refer to the [Changelog][action-view] for detailed changes.
|
|
290
506
|
|
291
507
|
### Notable changes
|
292
508
|
|
509
|
+
* `render "foo/bar"` now expands to `render template: "foo/bar"` instead of
|
510
|
+
`render file: "foo/bar"`.
|
511
|
+
([Pull Request](https://github.com/rails/rails/pull/16888))
|
512
|
+
|
293
513
|
* Introduced a `#{partial_name}_iteration` special local variable for use with
|
294
514
|
partials that are rendered with a collection. It provides access to the
|
295
515
|
current state of the iteration via the `#index`, `#size`, `#first?` and
|
@@ -300,6 +520,9 @@ Please refer to the [Changelog][action-view] for detailed changes.
|
|
300
520
|
the hidden fields.
|
301
521
|
([Pull Request](https://github.com/rails/rails/pull/14738))
|
302
522
|
|
523
|
+
* Placeholder I18n follows the same convention as `label` I18n.
|
524
|
+
([Pull Request](https://github.com/rails/rails/pull/16438))
|
525
|
+
|
303
526
|
|
304
527
|
Action Mailer
|
305
528
|
-------------
|
@@ -311,10 +534,13 @@ Please refer to the [Changelog][action-mailer] for detailed changes.
|
|
311
534
|
* Deprecated `*_path` helpers in mailers. Always use `*_url` helpers instead.
|
312
535
|
([Pull Request](https://github.com/rails/rails/pull/15840))
|
313
536
|
|
537
|
+
* Deprecated `deliver` / `deliver!` in favour of `deliver_now` / `deliver_now!`.
|
538
|
+
([Pull Request](https://github.com/rails/rails/pull/16582))
|
539
|
+
|
314
540
|
### Notable changes
|
315
541
|
|
316
542
|
* Introduced `deliver_later` which enqueues a job on the application's queue
|
317
|
-
to deliver
|
543
|
+
to deliver emails asynchronously.
|
318
544
|
([Pull Request](https://github.com/rails/rails/pull/16485))
|
319
545
|
|
320
546
|
* Added the `show_previews` configuration option for enabling mailer previews
|
@@ -325,9 +551,7 @@ Please refer to the [Changelog][action-mailer] for detailed changes.
|
|
325
551
|
Active Record
|
326
552
|
-------------
|
327
553
|
|
328
|
-
Please refer to the
|
329
|
-
[Changelog](https://github.com/rails/rails/blob/4-2-stable/activerecord/CHANGELOG.md)
|
330
|
-
for detailed changes.
|
554
|
+
Please refer to the [Changelog][active-record] for detailed changes.
|
331
555
|
|
332
556
|
### Removals
|
333
557
|
|
@@ -343,7 +567,7 @@ for detailed changes.
|
|
343
567
|
|
344
568
|
* Removed unused `:timestamp` type. Transparently alias it to `:datetime`
|
345
569
|
in all cases. Fixes inconsistencies when column types are sent outside of
|
346
|
-
`ActiveRecord`, such as for XML
|
570
|
+
`ActiveRecord`, such as for XML serialization.
|
347
571
|
([Pull Request](https://github.com/rails/rails/pull/15184))
|
348
572
|
|
349
573
|
### Deprecations
|
@@ -438,7 +662,7 @@ for detailed changes.
|
|
438
662
|
* `sqlite3:///some/path` now resolves to the absolute system path
|
439
663
|
`/some/path`. For relative paths, use `sqlite3:some/path` instead.
|
440
664
|
(Previously, `sqlite3:///some/path` resolved to the relative path
|
441
|
-
`some/path`. This behaviour was deprecated on Rails 4.1.
|
665
|
+
`some/path`. This behaviour was deprecated on Rails 4.1).
|
442
666
|
([Pull Request](https://github.com/rails/rails/pull/14569))
|
443
667
|
|
444
668
|
* Introduced `#validate` as an alias for `#valid?`.
|
@@ -470,19 +694,21 @@ Please refer to the [Changelog][active-model] for detailed changes.
|
|
470
694
|
|
471
695
|
### Deprecations
|
472
696
|
|
473
|
-
* Deprecated reset_#{attribute} in favor of restore_#{attribute}
|
697
|
+
* Deprecated `reset_#{attribute}` in favor of `restore_#{attribute}`.
|
474
698
|
([Pull Request](https://github.com/rails/rails/pull/16180))
|
475
699
|
|
476
|
-
* Deprecated ActiveModel::Dirty#reset_changes in favor of
|
700
|
+
* Deprecated `ActiveModel::Dirty#reset_changes` in favor of
|
701
|
+
`#clear_changes_information`.
|
477
702
|
([Pull Request](https://github.com/rails/rails/pull/16180))
|
478
703
|
|
479
704
|
### Notable changes
|
480
705
|
|
481
706
|
* Introduced the `restore_attributes` method in `ActiveModel::Dirty` to restore
|
482
707
|
the changed (dirty) attributes to their previous values.
|
483
|
-
(Pull Request [1](https://github.com/rails/rails/pull/14861),
|
708
|
+
(Pull Request [1](https://github.com/rails/rails/pull/14861),
|
709
|
+
[2](https://github.com/rails/rails/pull/16180))
|
484
710
|
|
485
|
-
* `has_secure_password` no longer
|
711
|
+
* `has_secure_password` no longer disallows blank passwords (i.e. passwords
|
486
712
|
that contains only spaces) by default.
|
487
713
|
([Pull Request](https://github.com/rails/rails/pull/16412))
|
488
714
|
|
@@ -524,13 +750,14 @@ Please refer to the [Changelog][active-support] for detailed changes.
|
|
524
750
|
|
525
751
|
### Notable changes
|
526
752
|
|
753
|
+
* Introduced new configuration option `active_support.test_order` for
|
754
|
+
specifying the order test cases are executed. This option currently defaults
|
755
|
+
to `:sorted` but will be changed to `:random` in Rails 5.0.
|
756
|
+
([Commit](TODO: fill me in))
|
757
|
+
|
527
758
|
* The `travel_to` test helper now truncates the `usec` component to 0.
|
528
759
|
([Commit](https://github.com/rails/rails/commit/9f6e82ee4783e491c20f5244a613fdeb4024beb5))
|
529
760
|
|
530
|
-
* `ActiveSupport::TestCase` now randomizes the order that test cases are ran
|
531
|
-
by default.
|
532
|
-
([Commit](https://github.com/rails/rails/commit/6ffb29d24e05abbd9ffe3ea974140d6c70221807))
|
533
|
-
|
534
761
|
* Introduced `Object#itself` as an identity function.
|
535
762
|
(Commit [1](https://github.com/rails/rails/commit/702ad710b57bef45b081ebf42e6fa70820fdd810),
|
536
763
|
[2](https://github.com/rails/rails/commit/64d91122222c11ad3918cc8e2e3ebc4b0a03448a))
|