rails 3.2.22.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +85 -0
  3. data/guides/CHANGELOG.md +31 -0
  4. data/guides/Rakefile +79 -0
  5. data/guides/assets/images/akshaysurve.jpg +0 -0
  6. data/guides/assets/images/belongs_to.png +0 -0
  7. data/guides/assets/images/book_icon.gif +0 -0
  8. data/guides/assets/images/bullet.gif +0 -0
  9. data/guides/assets/images/chapters_icon.gif +0 -0
  10. data/guides/assets/images/check_bullet.gif +0 -0
  11. data/guides/assets/images/credits_pic_blank.gif +0 -0
  12. data/guides/assets/images/csrf.png +0 -0
  13. data/guides/assets/images/edge_badge.png +0 -0
  14. data/guides/assets/images/favicon.ico +0 -0
  15. data/guides/assets/images/feature_tile.gif +0 -0
  16. data/guides/assets/images/footer_tile.gif +0 -0
  17. data/guides/assets/images/fxn.png +0 -0
  18. data/guides/assets/images/getting_started/article_with_comments.png +0 -0
  19. data/guides/assets/images/getting_started/challenge.png +0 -0
  20. data/guides/assets/images/getting_started/confirm_dialog.png +0 -0
  21. data/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
  22. data/guides/assets/images/getting_started/form_with_errors.png +0 -0
  23. data/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
  24. data/guides/assets/images/getting_started/new_article.png +0 -0
  25. data/guides/assets/images/getting_started/rails_welcome.png +0 -0
  26. data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
  27. data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
  28. data/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
  29. data/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
  30. data/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
  31. data/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
  32. data/guides/assets/images/grey_bullet.gif +0 -0
  33. data/guides/assets/images/habtm.png +0 -0
  34. data/guides/assets/images/has_many.png +0 -0
  35. data/guides/assets/images/has_many_through.png +0 -0
  36. data/guides/assets/images/has_one.png +0 -0
  37. data/guides/assets/images/has_one_through.png +0 -0
  38. data/guides/assets/images/header_backdrop.png +0 -0
  39. data/guides/assets/images/header_tile.gif +0 -0
  40. data/guides/assets/images/i18n/demo_html_safe.png +0 -0
  41. data/guides/assets/images/i18n/demo_localized_pirate.png +0 -0
  42. data/guides/assets/images/i18n/demo_translated_en.png +0 -0
  43. data/guides/assets/images/i18n/demo_translated_pirate.png +0 -0
  44. data/guides/assets/images/i18n/demo_translation_missing.png +0 -0
  45. data/guides/assets/images/i18n/demo_untranslated.png +0 -0
  46. data/guides/assets/images/icons/README +5 -0
  47. data/guides/assets/images/icons/callouts/1.png +0 -0
  48. data/guides/assets/images/icons/callouts/10.png +0 -0
  49. data/guides/assets/images/icons/callouts/11.png +0 -0
  50. data/guides/assets/images/icons/callouts/12.png +0 -0
  51. data/guides/assets/images/icons/callouts/13.png +0 -0
  52. data/guides/assets/images/icons/callouts/14.png +0 -0
  53. data/guides/assets/images/icons/callouts/15.png +0 -0
  54. data/guides/assets/images/icons/callouts/2.png +0 -0
  55. data/guides/assets/images/icons/callouts/3.png +0 -0
  56. data/guides/assets/images/icons/callouts/4.png +0 -0
  57. data/guides/assets/images/icons/callouts/5.png +0 -0
  58. data/guides/assets/images/icons/callouts/6.png +0 -0
  59. data/guides/assets/images/icons/callouts/7.png +0 -0
  60. data/guides/assets/images/icons/callouts/8.png +0 -0
  61. data/guides/assets/images/icons/callouts/9.png +0 -0
  62. data/guides/assets/images/icons/caution.png +0 -0
  63. data/guides/assets/images/icons/example.png +0 -0
  64. data/guides/assets/images/icons/home.png +0 -0
  65. data/guides/assets/images/icons/important.png +0 -0
  66. data/guides/assets/images/icons/next.png +0 -0
  67. data/guides/assets/images/icons/note.png +0 -0
  68. data/guides/assets/images/icons/prev.png +0 -0
  69. data/guides/assets/images/icons/tip.png +0 -0
  70. data/guides/assets/images/icons/up.png +0 -0
  71. data/guides/assets/images/icons/warning.png +0 -0
  72. data/guides/assets/images/nav_arrow.gif +0 -0
  73. data/guides/assets/images/oscardelben.jpg +0 -0
  74. data/guides/assets/images/polymorphic.png +0 -0
  75. data/guides/assets/images/radar.png +0 -0
  76. data/guides/assets/images/rails4_features.png +0 -0
  77. data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
  78. data/guides/assets/images/rails_guides_logo.gif +0 -0
  79. data/guides/assets/images/rails_logo_remix.gif +0 -0
  80. data/guides/assets/images/session_fixation.png +0 -0
  81. data/guides/assets/images/tab_grey.gif +0 -0
  82. data/guides/assets/images/tab_info.gif +0 -0
  83. data/guides/assets/images/tab_note.gif +0 -0
  84. data/guides/assets/images/tab_red.gif +0 -0
  85. data/guides/assets/images/tab_yellow.gif +0 -0
  86. data/guides/assets/images/tab_yellow.png +0 -0
  87. data/guides/assets/images/vijaydev.jpg +0 -0
  88. data/guides/assets/javascripts/guides.js +59 -0
  89. data/guides/assets/javascripts/jquery.min.js +4 -0
  90. data/guides/assets/javascripts/responsive-tables.js +43 -0
  91. data/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
  92. data/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
  93. data/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
  94. data/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
  95. data/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
  96. data/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
  97. data/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
  98. data/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
  99. data/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
  100. data/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
  101. data/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
  102. data/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
  103. data/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
  104. data/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
  105. data/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
  106. data/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
  107. data/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
  108. data/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
  109. data/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
  110. data/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
  111. data/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
  112. data/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
  113. data/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
  114. data/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
  115. data/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
  116. data/guides/assets/javascripts/syntaxhighlighter/shCore.js +17 -0
  117. data/guides/assets/stylesheets/fixes.css +16 -0
  118. data/guides/assets/stylesheets/kindle.css +11 -0
  119. data/guides/assets/stylesheets/main.css +713 -0
  120. data/guides/assets/stylesheets/print.css +52 -0
  121. data/guides/assets/stylesheets/reset.css +43 -0
  122. data/guides/assets/stylesheets/responsive-tables.css +50 -0
  123. data/guides/assets/stylesheets/style.css +13 -0
  124. data/guides/assets/stylesheets/syntaxhighlighter/shCore.css +226 -0
  125. data/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
  126. data/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
  127. data/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
  128. data/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
  129. data/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
  130. data/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
  131. data/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
  132. data/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
  133. data/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
  134. data/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
  135. data/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
  136. data/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
  137. data/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
  138. data/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
  139. data/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
  140. data/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
  141. data/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
  142. data/guides/bug_report_templates/action_controller_gem.rb +47 -0
  143. data/guides/bug_report_templates/action_controller_master.rb +54 -0
  144. data/guides/bug_report_templates/active_record_gem.rb +40 -0
  145. data/guides/bug_report_templates/active_record_master.rb +49 -0
  146. data/guides/rails_guides/generator.rb +248 -0
  147. data/guides/rails_guides/helpers.rb +53 -0
  148. data/guides/rails_guides/indexer.rb +68 -0
  149. data/guides/rails_guides/kindle.rb +119 -0
  150. data/guides/rails_guides/levenshtein.rb +39 -0
  151. data/guides/rails_guides/markdown/renderer.rb +82 -0
  152. data/guides/rails_guides/markdown.rb +167 -0
  153. data/guides/rails_guides.rb +63 -0
  154. data/guides/source/2_2_release_notes.md +435 -0
  155. data/guides/source/2_3_release_notes.md +621 -0
  156. data/guides/source/3_0_release_notes.md +611 -0
  157. data/guides/source/3_1_release_notes.md +559 -0
  158. data/guides/source/3_2_release_notes.md +568 -0
  159. data/guides/source/4_0_release_notes.md +279 -0
  160. data/guides/source/4_1_release_notes.md +730 -0
  161. data/guides/source/4_2_release_notes.md +850 -0
  162. data/guides/source/_license.html.erb +2 -0
  163. data/guides/source/_welcome.html.erb +19 -0
  164. data/guides/source/action_controller_overview.md +1249 -0
  165. data/guides/source/action_mailer_basics.md +752 -0
  166. data/guides/source/action_view_overview.md +1620 -0
  167. data/guides/source/active_job_basics.md +318 -0
  168. data/guides/source/active_model_basics.md +554 -0
  169. data/guides/source/active_record_basics.md +374 -0
  170. data/guides/source/active_record_callbacks.md +413 -0
  171. data/guides/source/active_record_migrations.md +1018 -0
  172. data/guides/source/active_record_postgresql.md +433 -0
  173. data/guides/source/active_record_querying.md +1783 -0
  174. data/guides/source/active_record_validations.md +1178 -0
  175. data/guides/source/active_support_core_extensions.md +3904 -0
  176. data/guides/source/active_support_instrumentation.md +499 -0
  177. data/guides/source/api_documentation_guidelines.md +361 -0
  178. data/guides/source/asset_pipeline.md +1360 -0
  179. data/guides/source/association_basics.md +2236 -0
  180. data/guides/source/caching_with_rails.md +379 -0
  181. data/guides/source/command_line.md +625 -0
  182. data/guides/source/configuring.md +1045 -0
  183. data/guides/source/constant_autoloading_and_reloading.md +1297 -0
  184. data/guides/source/contributing_to_ruby_on_rails.md +624 -0
  185. data/guides/source/credits.html.erb +80 -0
  186. data/guides/source/debugging_rails_applications.md +861 -0
  187. data/guides/source/development_dependencies_install.md +289 -0
  188. data/guides/source/documents.yaml +205 -0
  189. data/guides/source/engines.md +1412 -0
  190. data/guides/source/form_helpers.md +1024 -0
  191. data/guides/source/generators.md +676 -0
  192. data/guides/source/getting_started.md +2085 -0
  193. data/guides/source/i18n.md +1086 -0
  194. data/guides/source/index.html.erb +28 -0
  195. data/guides/source/initialization.md +704 -0
  196. data/guides/source/kindle/copyright.html.erb +1 -0
  197. data/guides/source/kindle/layout.html.erb +27 -0
  198. data/guides/source/kindle/rails_guides.opf.erb +52 -0
  199. data/guides/source/kindle/toc.html.erb +24 -0
  200. data/guides/source/kindle/toc.ncx.erb +64 -0
  201. data/guides/source/kindle/welcome.html.erb +5 -0
  202. data/guides/source/layout.html.erb +143 -0
  203. data/guides/source/layouts_and_rendering.md +1227 -0
  204. data/guides/source/maintenance_policy.md +78 -0
  205. data/guides/source/nested_model_forms.md +228 -0
  206. data/guides/source/plugins.md +444 -0
  207. data/guides/source/rails_application_templates.md +266 -0
  208. data/guides/source/rails_on_rack.md +336 -0
  209. data/guides/source/routing.md +1141 -0
  210. data/guides/source/ruby_on_rails_guides_guidelines.md +127 -0
  211. data/guides/source/security.md +1024 -0
  212. data/guides/source/testing.md +1123 -0
  213. data/guides/source/upgrading_ruby_on_rails.md +1154 -0
  214. data/guides/source/working_with_javascript_in_rails.md +407 -0
  215. data/guides/w3c_validator.rb +97 -0
  216. metadata +290 -44
@@ -0,0 +1,850 @@
1
+ Ruby on Rails 4.2 Release Notes
2
+ ===============================
3
+
4
+ Highlights in Rails 4.2:
5
+
6
+ * Active Job
7
+ * Asynchronous mails
8
+ * Adequate Record
9
+ * Web Console
10
+ * Foreign key support
11
+
12
+ These release notes cover only the major changes. To learn about other
13
+ features, bug fixes, and changes, please refer to the changelogs or check out
14
+ the [list of commits](https://github.com/rails/rails/commits/4-2-stable) in
15
+ the main Rails repository on GitHub.
16
+
17
+ --------------------------------------------------------------------------------
18
+
19
+ Upgrading to Rails 4.2
20
+ ----------------------
21
+
22
+ If you're upgrading an existing application, it's a great idea to have good test
23
+ coverage before going in. You should also first upgrade to Rails 4.1 in case you
24
+ haven't and make sure your application still runs as expected before attempting
25
+ to upgrade to Rails 4.2. A list of things to watch out for when upgrading is
26
+ available in the guide [Upgrading Ruby on
27
+ Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-4-1-to-rails-4-2).
28
+
29
+
30
+ Major Features
31
+ --------------
32
+
33
+ ### Active Job
34
+
35
+ Active Job is a new framework in Rails 4.2. It is a common interface on top of
36
+ queuing systems like [Resque](https://github.com/resque/resque), [Delayed
37
+ Job](https://github.com/collectiveidea/delayed_job),
38
+ [Sidekiq](https://github.com/mperham/sidekiq), and more.
39
+
40
+ Jobs written with the Active Job API run on any of the supported queues thanks
41
+ to their respective adapters. Active Job comes pre-configured with an inline
42
+ runner that executes jobs right away.
43
+
44
+ Jobs often need to take Active Record objects as arguments. Active Job passes
45
+ object references as URIs (uniform resource identifiers) instead of marshaling
46
+ the object itself. The new [Global ID](https://github.com/rails/globalid)
47
+ library builds URIs and looks up the objects they reference. Passing Active
48
+ Record objects as job arguments just works by using Global ID internally.
49
+
50
+ For example, if `trashable` is an Active Record object, then this job runs
51
+ just fine with no serialization involved:
52
+
53
+ ```ruby
54
+ class TrashableCleanupJob < ActiveJob::Base
55
+ def perform(trashable, depth)
56
+ trashable.cleanup(depth)
57
+ end
58
+ end
59
+ ```
60
+
61
+ See the [Active Job Basics](active_job_basics.html) guide for more
62
+ information.
63
+
64
+ ### Asynchronous Mails
65
+
66
+ Building on top of Active Job, Action Mailer now comes with a `deliver_later`
67
+ method that sends emails via the queue, so it doesn't block the controller or
68
+ model if the queue is asynchronous (the default inline queue blocks).
69
+
70
+ Sending emails right away is still possible with `deliver_now`.
71
+
72
+ ### Adequate Record
73
+
74
+ Adequate Record is a set of performance improvements in Active Record that makes
75
+ common `find` and `find_by` calls and some association queries up to 2x faster.
76
+
77
+ It works by caching common SQL queries as prepared statements and reusing them
78
+ on similar calls, skipping most of the query-generation work on subsequent
79
+ calls. For more details, please refer to [Aaron Patterson's blog
80
+ post](http://tenderlovemaking.com/2014/02/19/adequaterecord-pro-like-activerecord.html).
81
+
82
+ Active Record will automatically take advantage of this feature on
83
+ supported operations without any user involvement or code changes. Here are
84
+ some examples of supported operations:
85
+
86
+ ```ruby
87
+ Post.find(1) # First call generates and cache the prepared statement
88
+ Post.find(2) # Subsequent calls reuse the cached prepared statement
89
+
90
+ Post.find_by_title('first post')
91
+ Post.find_by_title('second post')
92
+
93
+ post.comments
94
+ post.comments(true)
95
+ ```
96
+
97
+ It's important to highlight that, as the examples above suggest, the prepared
98
+ statements do not cache the values passed in the method calls; rather, they
99
+ have placeholders for them.
100
+
101
+ Caching is not used in the following scenarios:
102
+
103
+ - The model has a default scope
104
+ - The model uses single table inheritance
105
+ - `find` with a list of ids, e.g.:
106
+
107
+ ```ruby
108
+ # not cached
109
+ Post.find(1, 2, 3)
110
+ Post.find([1,2])
111
+ ```
112
+
113
+ - `find_by` with SQL fragments:
114
+
115
+ ```ruby
116
+ Post.find_by('published_at < ?', 2.weeks.ago)
117
+ ```
118
+
119
+ ### Web Console
120
+
121
+ New applications generated with Rails 4.2 now come with the [Web
122
+ Console](https://github.com/rails/web-console) gem by default. Web Console adds
123
+ an interactive Ruby console on every error page and provides a `console` view
124
+ and controller helpers.
125
+
126
+ The interactive console on error pages lets you execute code in the context of
127
+ the place where the exception originated. The `console` helper, if called
128
+ anywhere in a view or controller, launches an interactive console with the final
129
+ context, once rendering has completed.
130
+
131
+ ### Foreign Key Support
132
+
133
+ The migration DSL now supports adding and removing foreign keys. They are dumped
134
+ to `schema.rb` as well. At this time, only the `mysql`, `mysql2` and `postgresql`
135
+ adapters support foreign keys.
136
+
137
+ ```ruby
138
+ # add a foreign key to `articles.author_id` referencing `authors.id`
139
+ add_foreign_key :articles, :authors
140
+
141
+ # add a foreign key to `articles.author_id` referencing `users.lng_id`
142
+ add_foreign_key :articles, :users, column: :author_id, primary_key: "lng_id"
143
+
144
+ # remove the foreign key on `accounts.branch_id`
145
+ remove_foreign_key :accounts, :branches
146
+
147
+ # remove the foreign key on `accounts.owner_id`
148
+ remove_foreign_key :accounts, column: :owner_id
149
+ ```
150
+
151
+ See the API documentation on
152
+ [add_foreign_key](http://api.rubyonrails.org/v4.2.0/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_foreign_key)
153
+ and
154
+ [remove_foreign_key](http://api.rubyonrails.org/v4.2.0/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_foreign_key)
155
+ for a full description.
156
+
157
+
158
+ Incompatibilities
159
+ -----------------
160
+
161
+ Previously deprecated functionality has been removed. Please refer to the
162
+ individual components for new deprecations in this release.
163
+
164
+ The following changes may require immediate action upon upgrade.
165
+
166
+ ### `render` with a String Argument
167
+
168
+ Previously, calling `render "foo/bar"` in a controller action was equivalent to
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.
172
+
173
+ ### `respond_with` / Class-Level `respond_to`
174
+
175
+ `respond_with` and the corresponding class-level `respond_to` have been moved
176
+ to the [responders](https://github.com/plataformatec/responders) gem. Add
177
+ `gem 'responders', '~> 2.0'` to your Gemfile to use it:
178
+
179
+ ```ruby
180
+ # app/controllers/users_controller.rb
181
+
182
+ class UsersController < ApplicationController
183
+ respond_to :html, :json
184
+
185
+ def show
186
+ @user = User.find(params[:id])
187
+ respond_with @user
188
+ end
189
+ end
190
+ ```
191
+
192
+ Instance-level `respond_to` is unaffected:
193
+
194
+ ```ruby
195
+ # app/controllers/users_controller.rb
196
+
197
+ class UsersController < ApplicationController
198
+ def show
199
+ @user = User.find(params[:id])
200
+ respond_to do |format|
201
+ format.html
202
+ format.json { render json: @user }
203
+ end
204
+ end
205
+ end
206
+ ```
207
+
208
+ ### Default Host for `rails server`
209
+
210
+ Due to a [change in Rack](https://github.com/rack/rack/commit/28b014484a8ac0bbb388e7eaeeef159598ec64fc),
211
+ `rails server` now listens on `localhost` instead of `0.0.0.0` by default. This
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
+
216
+ However, with this change you will no longer be able to access the Rails
217
+ server from a different machine, for example if your development environment
218
+ is in a virtual machine and you would like to access it from the host machine.
219
+ In such cases, please start the server with `rails server -b 0.0.0.0` to
220
+ restore the old behavior.
221
+
222
+ If you do this, be sure to configure your firewall properly such that only
223
+ trusted machines on your network can access your development server.
224
+
225
+ ### HTML Sanitizer
226
+
227
+ The HTML sanitizer has been replaced with a new, more robust, implementation
228
+ built upon [Loofah](https://github.com/flavorjones/loofah) and
229
+ [Nokogiri](https://github.com/sparklemotion/nokogiri). The new sanitizer is
230
+ more secure and its sanitization is more powerful and flexible.
231
+
232
+ Due to the new algorithm, the sanitized output may be different for certain
233
+ pathological inputs.
234
+
235
+ If you have a particular need for the exact output of the old sanitizer, you
236
+ can add the [rails-deprecated_sanitizer](https://github.com/kaspth/rails-deprecated_sanitizer)
237
+ gem to the `Gemfile`, to have the old behavior. The gem does not issue
238
+ deprecation warnings because it is opt-in.
239
+
240
+ `rails-deprecated_sanitizer` will be supported for Rails 4.2 only; it will not
241
+ be maintained for Rails 5.0.
242
+
243
+ See [this blog post](http://blog.plataformatec.com.br/2014/07/the-new-html-sanitizer-in-rails-4-2/)
244
+ for more details on the changes in the new sanitizer.
245
+
246
+ ### `assert_select`
247
+
248
+ `assert_select` is now based on [Nokogiri](https://github.com/sparklemotion/nokogiri).
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
+ # before
257
+ a[href=/]
258
+ a[href$=/]
259
+
260
+ # now
261
+ a[href="/"]
262
+ a[href$="/"]
263
+ ```
264
+
265
+ * DOMs built from HTML source containing invalid HTML with improperly
266
+ nested elements may differ.
267
+
268
+ For example:
269
+
270
+ ``` ruby
271
+ # content: <div><i><p></i></div>
272
+
273
+ # before:
274
+ assert_select('div > i') # => true
275
+ assert_select('div > p') # => false
276
+ assert_select('i > p') # => true
277
+
278
+ # now:
279
+ assert_select('div > i') # => true
280
+ assert_select('div > p') # => true
281
+ assert_select('i > p') # => false
282
+ ```
283
+
284
+ * If the data selected contains entities, the value selected for comparison
285
+ used to be raw (e.g. `AT&amp;T`), and now is evaluated
286
+ (e.g. `AT&T`).
287
+
288
+ ``` ruby
289
+ # content: <p>AT&amp;T</p>
290
+
291
+ # before:
292
+ assert_select('p', 'AT&amp;T') # => true
293
+ assert_select('p', 'AT&T') # => false
294
+
295
+ # now:
296
+ assert_select('p', 'AT&T') # => true
297
+ assert_select('p', 'AT&amp;T') # => false
298
+ ```
299
+
300
+
301
+ Railties
302
+ --------
303
+
304
+ Please refer to the [Changelog][railties] for detailed changes.
305
+
306
+ ### Removals
307
+
308
+ * The `--skip-action-view` option has been removed from the
309
+ app generator. ([Pull Request](https://github.com/rails/rails/pull/17042))
310
+
311
+ * The `rails application` command has been removed without replacement.
312
+ ([Pull Request](https://github.com/rails/rails/pull/11616))
313
+
314
+ ### Deprecations
315
+
316
+ * Deprecated missing `config.log_level` for production environments.
317
+ ([Pull Request](https://github.com/rails/rails/pull/16622))
318
+
319
+ * Deprecated `rake test:all` in favor of `rake test` as it now run all tests
320
+ in the `test` folder.
321
+ ([Pull Request](https://github.com/rails/rails/pull/17348))
322
+
323
+ * Deprecated `rake test:all:db` in favor of `rake test:db`.
324
+ ([Pull Request](https://github.com/rails/rails/pull/17348))
325
+
326
+ * Deprecated `Rails::Rack::LogTailer` without replacement.
327
+ ([Commit](https://github.com/rails/rails/commit/84a13e019e93efaa8994b3f8303d635a7702dbce))
328
+
329
+ ### Notable changes
330
+
331
+ * Introduced `web-console` in the default application Gemfile.
332
+ ([Pull Request](https://github.com/rails/rails/pull/11667))
333
+
334
+ * Added a `required` option to the model generator for associations.
335
+ ([Pull Request](https://github.com/rails/rails/pull/16062))
336
+
337
+ * Introduced the `x` namespace for defining custom configuration options:
338
+
339
+ ```ruby
340
+ # config/environments/production.rb
341
+ config.x.payment_processing.schedule = :daily
342
+ config.x.payment_processing.retries = 3
343
+ config.x.super_debugger = true
344
+ ```
345
+
346
+ These options are then available through the configuration object:
347
+
348
+ ```ruby
349
+ Rails.configuration.x.payment_processing.schedule # => :daily
350
+ Rails.configuration.x.payment_processing.retries # => 3
351
+ Rails.configuration.x.super_debugger # => true
352
+ ```
353
+
354
+ ([Commit](https://github.com/rails/rails/commit/611849772dd66c2e4d005dcfe153f7ce79a8a7db))
355
+
356
+ * Introduced `Rails::Application.config_for` to load a configuration for the
357
+ current environment.
358
+
359
+ ```ruby
360
+ # config/exception_notification.yml:
361
+ production:
362
+ url: http://127.0.0.1:8080
363
+ namespace: my_app_production
364
+ development:
365
+ url: http://localhost:3001
366
+ namespace: my_app_development
367
+
368
+ # config/production.rb
369
+ Rails.application.configure do
370
+ config.middleware.use ExceptionNotifier, config_for(:exception_notification)
371
+ end
372
+ ```
373
+
374
+ ([Pull Request](https://github.com/rails/rails/pull/16129))
375
+
376
+ * Introduced a `--skip-turbolinks` option in the app generator to not generate
377
+ turbolinks integration.
378
+ ([Commit](https://github.com/rails/rails/commit/bf17c8a531bc8059d50ad731398002a3e7162a7d))
379
+
380
+ * Introduced a `bin/setup` script as a convention for automated setup code when
381
+ bootstrapping an application.
382
+ ([Pull Request](https://github.com/rails/rails/pull/15189))
383
+
384
+ * Changed the default value for `config.assets.digest` to `true` in development.
385
+ ([Pull Request](https://github.com/rails/rails/pull/15155))
386
+
387
+ * Introduced an API to register new extensions for `rake notes`.
388
+ ([Pull Request](https://github.com/rails/rails/pull/14379))
389
+
390
+ * Introduced an `after_bundle` callback for use in Rails templates.
391
+ ([Pull Request](https://github.com/rails/rails/pull/16359))
392
+
393
+ * Introduced `Rails.gem_version` as a convenience method to return
394
+ `Gem::Version.new(Rails.version)`.
395
+ ([Pull Request](https://github.com/rails/rails/pull/14101))
396
+
397
+
398
+ Action Pack
399
+ -----------
400
+
401
+ Please refer to the [Changelog][action-pack] for detailed changes.
402
+
403
+ ### Removals
404
+
405
+ * `respond_with` and the class-level `respond_to` have been removed from Rails and
406
+ moved to the `responders` gem (version 2.0). Add `gem 'responders', '~> 2.0'`
407
+ to your `Gemfile` to continue using these features.
408
+ ([Pull Request](https://github.com/rails/rails/pull/16526),
409
+ [More Details](http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#responders))
410
+
411
+ * Removed deprecated `AbstractController::Helpers::ClassMethods::MissingHelperError`
412
+ in favor of `AbstractController::Helpers::MissingHelperError`.
413
+ ([Commit](https://github.com/rails/rails/commit/a1ddde15ae0d612ff2973de9cf768ed701b594e8))
414
+
415
+ ### Deprecations
416
+
417
+ * Deprecated the `only_path` option on `*_path` helpers.
418
+ ([Commit](https://github.com/rails/rails/commit/aa1fadd48fb40dd9396a383696134a259aa59db9))
419
+
420
+ * Deprecated `assert_tag`, `assert_no_tag`, `find_tag` and `find_all_tag` in
421
+ favor of `assert_select`.
422
+ ([Commit](https://github.com/rails/rails-dom-testing/commit/b12850bc5ff23ba4b599bf2770874dd4f11bf750))
423
+
424
+ * Deprecated support for setting the `:to` option of a router to a symbol or a
425
+ string that does not contain a "#" character:
426
+
427
+ ```ruby
428
+ get '/posts', to: MyRackApp => (No change necessary)
429
+ get '/posts', to: 'post#index' => (No change necessary)
430
+ get '/posts', to: 'posts' => get '/posts', controller: :posts
431
+ get '/posts', to: :index => get '/posts', action: :index
432
+ ```
433
+
434
+ ([Commit](https://github.com/rails/rails/commit/cc26b6b7bccf0eea2e2c1a9ebdcc9d30ca7390d9))
435
+
436
+ * Deprecated support for string keys in URL helpers:
437
+
438
+ ```ruby
439
+ # bad
440
+ root_path('controller' => 'posts', 'action' => 'index')
441
+
442
+ # good
443
+ root_path(controller: 'posts', action: 'index')
444
+ ```
445
+
446
+ ([Pull Request](https://github.com/rails/rails/pull/17743))
447
+
448
+ ### Notable changes
449
+
450
+ * The `*_filter` family of methods have been removed from the documentation. Their
451
+ usage is discouraged in favor of the `*_action` family of methods:
452
+
453
+ ```
454
+ after_filter => after_action
455
+ append_after_filter => append_after_action
456
+ append_around_filter => append_around_action
457
+ append_before_filter => append_before_action
458
+ around_filter => around_action
459
+ before_filter => before_action
460
+ prepend_after_filter => prepend_after_action
461
+ prepend_around_filter => prepend_around_action
462
+ prepend_before_filter => prepend_before_action
463
+ skip_after_filter => skip_after_action
464
+ skip_around_filter => skip_around_action
465
+ skip_before_filter => skip_before_action
466
+ skip_filter => skip_action_callback
467
+ ```
468
+
469
+ If your application currently depends on these methods, you should use the
470
+ replacement `*_action` methods instead. These methods will be deprecated in
471
+ the future and will eventually be removed from Rails.
472
+
473
+ (Commit [1](https://github.com/rails/rails/commit/6c5f43bab8206747a8591435b2aa0ff7051ad3de),
474
+ [2](https://github.com/rails/rails/commit/489a8f2a44dc9cea09154ee1ee2557d1f037c7d4))
475
+
476
+ * `render nothing: true` or rendering a `nil` body no longer add a single
477
+ space padding to the response body.
478
+ ([Pull Request](https://github.com/rails/rails/pull/14883))
479
+
480
+ * Rails now automatically includes the template's digest in ETags.
481
+ ([Pull Request](https://github.com/rails/rails/pull/16527))
482
+
483
+ * Segments that are passed into URL helpers are now automatically escaped.
484
+ ([Commit](https://github.com/rails/rails/commit/5460591f0226a9d248b7b4f89186bd5553e7768f))
485
+
486
+ * Introduced the `always_permitted_parameters` option to configure which
487
+ parameters are permitted globally. The default value of this configuration
488
+ is `['controller', 'action']`.
489
+ ([Pull Request](https://github.com/rails/rails/pull/15933))
490
+
491
+ * Added the HTTP method `MKCALENDAR` from [RFC 4791](https://tools.ietf.org/html/rfc4791).
492
+ ([Pull Request](https://github.com/rails/rails/pull/15121))
493
+
494
+ * `*_fragment.action_controller` notifications now include the controller
495
+ and action name in the payload.
496
+ ([Pull Request](https://github.com/rails/rails/pull/14137))
497
+
498
+ * Improved the Routing Error page with fuzzy matching for route search.
499
+ ([Pull Request](https://github.com/rails/rails/pull/14619))
500
+
501
+ * Added an option to disable logging of CSRF failures.
502
+ ([Pull Request](https://github.com/rails/rails/pull/14280))
503
+
504
+ * When the Rails server is set to serve static assets, gzip assets will now be
505
+ served if the client supports it and a pre-generated gzip file (`.gz`) is on disk.
506
+ By default the asset pipeline generates `.gz` files for all compressible assets.
507
+ Serving gzip files minimizes data transfer and speeds up asset requests. Always
508
+ [use a CDN](http://guides.rubyonrails.org/asset_pipeline.html#cdns) if you are
509
+ serving assets from your Rails server in production.
510
+ ([Pull Request](https://github.com/rails/rails/pull/16466))
511
+
512
+ * When calling the `process` helpers in an integration test the path needs to have
513
+ a leading slash. Previously you could omit it but that was a byproduct of the
514
+ implementation and not an intentional feature, e.g.:
515
+
516
+ ```ruby
517
+ test "list all posts" do
518
+ get "/posts"
519
+ assert_response :success
520
+ end
521
+ ```
522
+
523
+ Action View
524
+ -----------
525
+
526
+ Please refer to the [Changelog][action-view] for detailed changes.
527
+
528
+ ### Deprecations
529
+
530
+ * Deprecated `AbstractController::Base.parent_prefixes`.
531
+ Override `AbstractController::Base.local_prefixes` when you want to change
532
+ where to find views.
533
+ ([Pull Request](https://github.com/rails/rails/pull/15026))
534
+
535
+ * Deprecated `ActionView::Digestor#digest(name, format, finder, options = {})`.
536
+ Arguments should be passed as a hash instead.
537
+ ([Pull Request](https://github.com/rails/rails/pull/14243))
538
+
539
+ ### Notable changes
540
+
541
+ * `render "foo/bar"` now expands to `render template: "foo/bar"` instead of
542
+ `render file: "foo/bar"`.
543
+ ([Pull Request](https://github.com/rails/rails/pull/16888))
544
+
545
+ * The form helpers no longer generate a `<div>` element with inline CSS around
546
+ the hidden fields.
547
+ ([Pull Request](https://github.com/rails/rails/pull/14738))
548
+
549
+ * Introduced a `#{partial_name}_iteration` special local variable for use with
550
+ partials that are rendered with a collection. It provides access to the
551
+ current state of the iteration via the `index`, `size`, `first?` and
552
+ `last?` methods.
553
+ ([Pull Request](https://github.com/rails/rails/pull/7698))
554
+
555
+ * Placeholder I18n follows the same convention as `label` I18n.
556
+ ([Pull Request](https://github.com/rails/rails/pull/16438))
557
+
558
+
559
+ Action Mailer
560
+ -------------
561
+
562
+ Please refer to the [Changelog][action-mailer] for detailed changes.
563
+
564
+ ### Deprecations
565
+
566
+ * Deprecated `*_path` helpers in mailers. Always use `*_url` helpers instead.
567
+ ([Pull Request](https://github.com/rails/rails/pull/15840))
568
+
569
+ * Deprecated `deliver` / `deliver!` in favor of `deliver_now` / `deliver_now!`.
570
+ ([Pull Request](https://github.com/rails/rails/pull/16582))
571
+
572
+ ### Notable changes
573
+
574
+ * `link_to` and `url_for` generate absolute URLs by default in templates,
575
+ it is no longer needed to pass `only_path: false`.
576
+ ([Commit](https://github.com/rails/rails/commit/9685080a7677abfa5d288a81c3e078368c6bb67c))
577
+
578
+ * Introduced `deliver_later` which enqueues a job on the application's queue
579
+ to deliver emails asynchronously.
580
+ ([Pull Request](https://github.com/rails/rails/pull/16485))
581
+
582
+ * Added the `show_previews` configuration option for enabling mailer previews
583
+ outside of the development environment.
584
+ ([Pull Request](https://github.com/rails/rails/pull/15970))
585
+
586
+
587
+ Active Record
588
+ -------------
589
+
590
+ Please refer to the [Changelog][active-record] for detailed changes.
591
+
592
+ ### Removals
593
+
594
+ * Removed `cache_attributes` and friends. All attributes are cached.
595
+ ([Pull Request](https://github.com/rails/rails/pull/15429))
596
+
597
+ * Removed deprecated method `ActiveRecord::Base.quoted_locking_column`.
598
+ ([Pull Request](https://github.com/rails/rails/pull/15612))
599
+
600
+ * Removed deprecated `ActiveRecord::Migrator.proper_table_name`. Use the
601
+ `proper_table_name` instance method on `ActiveRecord::Migration` instead.
602
+ ([Pull Request](https://github.com/rails/rails/pull/15512))
603
+
604
+ * Removed unused `:timestamp` type. Transparently alias it to `:datetime`
605
+ in all cases. Fixes inconsistencies when column types are sent outside of
606
+ Active Record, such as for XML serialization.
607
+ ([Pull Request](https://github.com/rails/rails/pull/15184))
608
+
609
+ ### Deprecations
610
+
611
+ * Deprecated swallowing of errors inside `after_commit` and `after_rollback`.
612
+ ([Pull Request](https://github.com/rails/rails/pull/16537))
613
+
614
+ * Deprecated broken support for automatic detection of counter caches on
615
+ `has_many :through` associations. You should instead manually specify the
616
+ counter cache on the `has_many` and `belongs_to` associations for the
617
+ through records.
618
+ ([Pull Request](https://github.com/rails/rails/pull/15754))
619
+
620
+ * Deprecated passing Active Record objects to `.find` or `.exists?`. Call
621
+ `id` on the objects first.
622
+ (Commit [1](https://github.com/rails/rails/commit/d92ae6ccca3bcfd73546d612efaea011270bd270),
623
+ [2](https://github.com/rails/rails/commit/d35f0033c7dec2b8d8b52058fb8db495d49596f7))
624
+
625
+ * Deprecated half-baked support for PostgreSQL range values with excluding
626
+ beginnings. We currently map PostgreSQL ranges to Ruby ranges. This conversion
627
+ is not fully possible because Ruby ranges do not support excluded beginnings.
628
+
629
+ The current solution of incrementing the beginning is not correct
630
+ and is now deprecated. For subtypes where we don't know how to increment
631
+ (e.g. `succ` is not defined) it will raise an `ArgumentError` for ranges
632
+ with excluding beginnings.
633
+ ([Commit](https://github.com/rails/rails/commit/91949e48cf41af9f3e4ffba3e5eecf9b0a08bfc3))
634
+
635
+ * Deprecated calling `DatabaseTasks.load_schema` without a connection. Use
636
+ `DatabaseTasks.load_schema_current` instead.
637
+ ([Commit](https://github.com/rails/rails/commit/f15cef67f75e4b52fd45655d7c6ab6b35623c608))
638
+
639
+ * Deprecated `sanitize_sql_hash_for_conditions` without replacement. Using a
640
+ `Relation` for performing queries and updates is the preferred API.
641
+ ([Commit](https://github.com/rails/rails/commit/d5902c9e))
642
+
643
+ * Deprecated `add_timestamps` and `t.timestamps` without passing the `:null`
644
+ option. The default of `null: true` will change in Rails 5 to `null: false`.
645
+ ([Pull Request](https://github.com/rails/rails/pull/16481))
646
+
647
+ * Deprecated `Reflection#source_macro` without replacement as it is no longer
648
+ needed in Active Record.
649
+ ([Pull Request](https://github.com/rails/rails/pull/16373))
650
+
651
+ * Deprecated `serialized_attributes` without replacement.
652
+ ([Pull Request](https://github.com/rails/rails/pull/15704))
653
+
654
+ * Deprecated returning `nil` from `column_for_attribute` when no column
655
+ exists. It will return a null object in Rails 5.0.
656
+ ([Pull Request](https://github.com/rails/rails/pull/15878))
657
+
658
+ * Deprecated using `.joins`, `.preload` and `.eager_load` with associations
659
+ that depend on the instance state (i.e. those defined with a scope that
660
+ takes an argument) without replacement.
661
+ ([Commit](https://github.com/rails/rails/commit/ed56e596a0467390011bc9d56d462539776adac1))
662
+
663
+ ### Notable changes
664
+
665
+ * `SchemaDumper` uses `force: :cascade` on `create_table`. This makes it
666
+ possible to reload a schema when foreign keys are in place.
667
+
668
+ * Added a `:required` option to singular associations, which defines a
669
+ presence validation on the association.
670
+ ([Pull Request](https://github.com/rails/rails/pull/16056))
671
+
672
+ * `ActiveRecord::Dirty` now detects in-place changes to mutable values.
673
+ Serialized attributes on Active Record models are no longer saved when
674
+ unchanged. This also works with other types such as string columns and json
675
+ columns on PostgreSQL.
676
+ (Pull Requests [1](https://github.com/rails/rails/pull/15674),
677
+ [2](https://github.com/rails/rails/pull/15786),
678
+ [3](https://github.com/rails/rails/pull/15788))
679
+
680
+ * Introduced the `db:purge` Rake task to empty the database for the
681
+ current environment.
682
+ ([Commit](https://github.com/rails/rails/commit/e2f232aba15937a4b9d14bd91e0392c6d55be58d))
683
+
684
+ * Introduced `ActiveRecord::Base#validate!` that raises
685
+ `ActiveRecord::RecordInvalid` if the record is invalid.
686
+ ([Pull Request](https://github.com/rails/rails/pull/8639))
687
+
688
+ * Introduced `validate` as an alias for `valid?`.
689
+ ([Pull Request](https://github.com/rails/rails/pull/14456))
690
+
691
+ * `touch` now accepts multiple attributes to be touched at once.
692
+ ([Pull Request](https://github.com/rails/rails/pull/14423))
693
+
694
+ * The PostgreSQL adapter now supports the `jsonb` datatype in PostgreSQL 9.4+.
695
+ ([Pull Request](https://github.com/rails/rails/pull/16220))
696
+
697
+ * The PostgreSQL and SQLite adapters no longer add a default limit of 255
698
+ characters on string columns.
699
+ ([Pull Request](https://github.com/rails/rails/pull/14579))
700
+
701
+ * Added support for the `citext` column type in the PostgreSQL adapter.
702
+ ([Pull Request](https://github.com/rails/rails/pull/12523))
703
+
704
+ * Added support for user-created range types in the PostgreSQL adapter.
705
+ ([Commit](https://github.com/rails/rails/commit/4cb47167e747e8f9dc12b0ddaf82bdb68c03e032))
706
+
707
+ * `sqlite3:///some/path` now resolves to the absolute system path
708
+ `/some/path`. For relative paths, use `sqlite3:some/path` instead.
709
+ (Previously, `sqlite3:///some/path` resolved to the relative path
710
+ `some/path`. This behavior was deprecated on Rails 4.1).
711
+ ([Pull Request](https://github.com/rails/rails/pull/14569))
712
+
713
+ * Added support for fractional seconds for MySQL 5.6 and above.
714
+ (Pull Request [1](https://github.com/rails/rails/pull/8240),
715
+ [2](https://github.com/rails/rails/pull/14359))
716
+
717
+ * Added `ActiveRecord::Base#pretty_print` to pretty print models.
718
+ ([Pull Request](https://github.com/rails/rails/pull/15172))
719
+
720
+ * `ActiveRecord::Base#reload` now behaves the same as `m = Model.find(m.id)`,
721
+ meaning that it no longer retains the extra attributes from custom
722
+ `SELECT`s.
723
+ ([Pull Request](https://github.com/rails/rails/pull/15866))
724
+
725
+ * `ActiveRecord::Base#reflections` now returns a hash with string keys instead
726
+ of symbol keys. ([Pull Request](https://github.com/rails/rails/pull/17718))
727
+
728
+ * The `references` method in migrations now supports a `type` option for
729
+ specifying the type of the foreign key (e.g. `:uuid`).
730
+ ([Pull Request](https://github.com/rails/rails/pull/16231))
731
+
732
+ Active Model
733
+ ------------
734
+
735
+ Please refer to the [Changelog][active-model] for detailed changes.
736
+
737
+ ### Removals
738
+
739
+ * Removed deprecated `Validator#setup` without replacement.
740
+ ([Pull Request](https://github.com/rails/rails/pull/10716))
741
+
742
+ ### Deprecations
743
+
744
+ * Deprecated `reset_#{attribute}` in favor of `restore_#{attribute}`.
745
+ ([Pull Request](https://github.com/rails/rails/pull/16180))
746
+
747
+ * Deprecated `ActiveModel::Dirty#reset_changes` in favor of
748
+ `clear_changes_information`.
749
+ ([Pull Request](https://github.com/rails/rails/pull/16180))
750
+
751
+ ### Notable changes
752
+
753
+ * Introduced `validate` as an alias for `valid?`.
754
+ ([Pull Request](https://github.com/rails/rails/pull/14456))
755
+
756
+ * Introduced the `restore_attributes` method in `ActiveModel::Dirty` to restore
757
+ the changed (dirty) attributes to their previous values.
758
+ (Pull Request [1](https://github.com/rails/rails/pull/14861),
759
+ [2](https://github.com/rails/rails/pull/16180))
760
+
761
+ * `has_secure_password` no longer disallows blank passwords (i.e. passwords
762
+ that contains only spaces) by default.
763
+ ([Pull Request](https://github.com/rails/rails/pull/16412))
764
+
765
+ * `has_secure_password` now verifies that the given password is less than 72
766
+ characters if validations are enabled.
767
+ ([Pull Request](https://github.com/rails/rails/pull/15708))
768
+
769
+ Active Support
770
+ --------------
771
+
772
+ Please refer to the [Changelog][active-support] for detailed changes.
773
+
774
+ ### Removals
775
+
776
+ * Removed deprecated `Numeric#ago`, `Numeric#until`, `Numeric#since`,
777
+ `Numeric#from_now`.
778
+ ([Commit](https://github.com/rails/rails/commit/f1eddea1e3f6faf93581c43651348f48b2b7d8bb))
779
+
780
+ * Removed deprecated string based terminators for `ActiveSupport::Callbacks`.
781
+ ([Pull Request](https://github.com/rails/rails/pull/15100))
782
+
783
+ ### Deprecations
784
+
785
+ * Deprecated `Kernel#silence_stderr`, `Kernel#capture` and `Kernel#quietly`
786
+ without replacement.
787
+ ([Pull Request](https://github.com/rails/rails/pull/13392))
788
+
789
+ * Deprecated `Class#superclass_delegating_accessor`, use
790
+ `Class#class_attribute` instead.
791
+ ([Pull Request](https://github.com/rails/rails/pull/14271))
792
+
793
+ * Deprecated `ActiveSupport::SafeBuffer#prepend!` as
794
+ `ActiveSupport::SafeBuffer#prepend` now performs the same function.
795
+ ([Pull Request](https://github.com/rails/rails/pull/14529))
796
+
797
+ ### Notable changes
798
+
799
+ * Introduced a new configuration option `active_support.test_order` for
800
+ specifying the order test cases are executed. This option currently defaults
801
+ to `:sorted` but will be changed to `:random` in Rails 5.0.
802
+ ([Commit](https://github.com/rails/rails/commit/53e877f7d9291b2bf0b8c425f9e32ef35829f35b))
803
+
804
+ * `Object#try` and `Object#try!` can now be used without an explicit receiver in the block.
805
+ ([Commit](https://github.com/rails/rails/commit/5e51bdda59c9ba8e5faf86294e3e431bd45f1830),
806
+ [Pull Request](https://github.com/rails/rails/pull/17361))
807
+
808
+ * The `travel_to` test helper now truncates the `usec` component to 0.
809
+ ([Commit](https://github.com/rails/rails/commit/9f6e82ee4783e491c20f5244a613fdeb4024beb5))
810
+
811
+ * Introduced `Object#itself` as an identity function.
812
+ (Commit [1](https://github.com/rails/rails/commit/702ad710b57bef45b081ebf42e6fa70820fdd810),
813
+ [2](https://github.com/rails/rails/commit/64d91122222c11ad3918cc8e2e3ebc4b0a03448a))
814
+
815
+ * `Object#with_options` can now be used without an explicit receiver in the block.
816
+ ([Pull Request](https://github.com/rails/rails/pull/16339))
817
+
818
+ * Introduced `String#truncate_words` to truncate a string by a number of words.
819
+ ([Pull Request](https://github.com/rails/rails/pull/16190))
820
+
821
+ * Added `Hash#transform_values` and `Hash#transform_values!` to simplify a
822
+ common pattern where the values of a hash must change, but the keys are left
823
+ the same.
824
+ ([Pull Request](https://github.com/rails/rails/pull/15819))
825
+
826
+ * The `humanize` inflector helper now strips any leading underscores.
827
+ ([Commit](https://github.com/rails/rails/commit/daaa21bc7d20f2e4ff451637423a25ff2d5e75c7))
828
+
829
+ * Introduced `Concern#class_methods` as an alternative to
830
+ `module ClassMethods`, as well as `Kernel#concern` to avoid the
831
+ `module Foo; extend ActiveSupport::Concern; end` boilerplate.
832
+ ([Commit](https://github.com/rails/rails/commit/b16c36e688970df2f96f793a759365b248b582ad))
833
+
834
+ * New [guide](constant_autoloading_and_reloading.html) about constant autoloading and reloading.
835
+
836
+ Credits
837
+ -------
838
+
839
+ See the
840
+ [full list of contributors to Rails](http://contributors.rubyonrails.org/) for
841
+ the many people who spent many hours making Rails the stable and robust
842
+ framework it is today. Kudos to all of them.
843
+
844
+ [railties]: https://github.com/rails/rails/blob/4-2-stable/railties/CHANGELOG.md
845
+ [action-pack]: https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md
846
+ [action-view]: https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md
847
+ [action-mailer]: https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md
848
+ [active-record]: https://github.com/rails/rails/blob/4-2-stable/activerecord/CHANGELOG.md
849
+ [active-model]: https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md
850
+ [active-support]: https://github.com/rails/rails/blob/4-2-stable/activesupport/CHANGELOG.md