rails_test 4.2.0.beta1

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 (215) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +83 -0
  3. data/guides/CHANGELOG.md +27 -0
  4. data/guides/Rakefile +77 -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 +56 -0
  144. data/guides/bug_report_templates/active_record_gem.rb +40 -0
  145. data/guides/bug_report_templates/active_record_master.rb +51 -0
  146. data/guides/rails_guides.rb +63 -0
  147. data/guides/rails_guides/generator.rb +248 -0
  148. data/guides/rails_guides/helpers.rb +53 -0
  149. data/guides/rails_guides/indexer.rb +68 -0
  150. data/guides/rails_guides/kindle.rb +119 -0
  151. data/guides/rails_guides/levenshtein.rb +39 -0
  152. data/guides/rails_guides/markdown.rb +167 -0
  153. data/guides/rails_guides/markdown/renderer.rb +82 -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 +736 -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 +1247 -0
  165. data/guides/source/action_mailer_basics.md +738 -0
  166. data/guides/source/action_view_overview.md +1621 -0
  167. data/guides/source/active_job_basics.md +285 -0
  168. data/guides/source/active_model_basics.md +223 -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 +1016 -0
  172. data/guides/source/active_record_postgresql.md +438 -0
  173. data/guides/source/active_record_querying.md +1785 -0
  174. data/guides/source/active_record_validations.md +1169 -0
  175. data/guides/source/active_support_core_extensions.md +3924 -0
  176. data/guides/source/active_support_instrumentation.md +497 -0
  177. data/guides/source/api_documentation_guidelines.md +361 -0
  178. data/guides/source/asset_pipeline.md +1361 -0
  179. data/guides/source/association_basics.md +2238 -0
  180. data/guides/source/caching_with_rails.md +379 -0
  181. data/guides/source/command_line.md +634 -0
  182. data/guides/source/configuring.md +1019 -0
  183. data/guides/source/contributing_to_ruby_on_rails.md +607 -0
  184. data/guides/source/credits.html.erb +80 -0
  185. data/guides/source/debugging_rails_applications.md +861 -0
  186. data/guides/source/development_dependencies_install.md +289 -0
  187. data/guides/source/documents.yaml +197 -0
  188. data/guides/source/engines.md +1401 -0
  189. data/guides/source/form_helpers.md +1010 -0
  190. data/guides/source/generators.md +676 -0
  191. data/guides/source/getting_started.md +2085 -0
  192. data/guides/source/i18n.md +1073 -0
  193. data/guides/source/index.html.erb +28 -0
  194. data/guides/source/initialization.md +704 -0
  195. data/guides/source/kindle/copyright.html.erb +1 -0
  196. data/guides/source/kindle/layout.html.erb +27 -0
  197. data/guides/source/kindle/rails_guides.opf.erb +52 -0
  198. data/guides/source/kindle/toc.html.erb +24 -0
  199. data/guides/source/kindle/toc.ncx.erb +64 -0
  200. data/guides/source/kindle/welcome.html.erb +5 -0
  201. data/guides/source/layout.html.erb +143 -0
  202. data/guides/source/layouts_and_rendering.md +1227 -0
  203. data/guides/source/maintenance_policy.md +75 -0
  204. data/guides/source/nested_model_forms.md +228 -0
  205. data/guides/source/plugins.md +444 -0
  206. data/guides/source/rails_application_templates.md +266 -0
  207. data/guides/source/rails_on_rack.md +332 -0
  208. data/guides/source/routing.md +1141 -0
  209. data/guides/source/ruby_on_rails_guides_guidelines.md +126 -0
  210. data/guides/source/security.md +1024 -0
  211. data/guides/source/testing.md +1055 -0
  212. data/guides/source/upgrading_ruby_on_rails.md +1046 -0
  213. data/guides/source/working_with_javascript_in_rails.md +407 -0
  214. data/guides/w3c_validator.rb +97 -0
  215. metadata +404 -0
@@ -0,0 +1,736 @@
1
+ Ruby on Rails 4.2 Release Notes
2
+ ===============================
3
+
4
+ Highlights in Rails 4.2:
5
+
6
+ * Active Job, Action Mailer #deliver_later
7
+ * Adequate Record
8
+ * Web Console
9
+ * Foreign key support
10
+
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
+
16
+ --------------------------------------------------------------------------------
17
+
18
+ NOTE: This document is a work in progress, please help to improve this by sending
19
+ a [pull request](https://github.com/rails/rails/edit/master/guides/source/4_2_release_notes.md).
20
+
21
+ Upgrading to Rails 4.2
22
+ ----------------------
23
+
24
+ If you're upgrading an existing application, it's a great idea to have good test
25
+ coverage before going in. You should also first upgrade to Rails 4.1 in case you
26
+ haven't and make sure your application still runs as expected before attempting
27
+ to upgrade to Rails 4.2. A list of things to watch out for when upgrading is
28
+ available in the
29
+ [Upgrading Ruby on Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-4-1-to-rails-4-2)
30
+ guide.
31
+
32
+
33
+ Major Features
34
+ --------------
35
+
36
+ ### Active Job, Action Mailer #deliver_later
37
+
38
+ Active Job is a new framework in Rails 4.2. It is an adapter layer on top of
39
+ queuing systems like [Resque](https://github.com/resque/resque), [Delayed Job](https://github.com/collectiveidea/delayed_job), [Sidekiq](https://github.com/mperham/sidekiq), and more. You can write your
40
+ jobs with the Active Job API, and it'll run on all these queues with no changes
41
+ (it comes pre-configured with an inline runner).
42
+
43
+ Building on top of Active Job, Action Mailer now comes with a `#deliver_later`
44
+ method, which adds your email to be sent as a job to a queue, so it doesn't
45
+ bog down the controller or model.
46
+
47
+ The new GlobalID library makes it easy to pass Active Record objects to jobs by
48
+ serializing them in a generic form. This means you no longer have to manually
49
+ pack and unpack your Active Records by passing ids. Just give the job the
50
+ straight Active Record object, and it'll serialize it using GlobalID, and
51
+ deserialize it at run time.
52
+
53
+ ### Adequate Record
54
+
55
+ Rails 4.2 comes with a performance improvement feature called Adequate Record
56
+ for Active Record. A lot of common queries are now up to twice as fast in Rails
57
+ 4.2!
58
+
59
+ TODO: add some technical details
60
+
61
+ ### Web Console
62
+
63
+ New applications generated from Rails 4.2 now come with the Web Console gem by
64
+ default.
65
+
66
+ Web Console is a set of debugging tools for your Rails application. It will add
67
+ an interactive console on every error page, a `console` view helper and a VT100
68
+ compatible terminal.
69
+
70
+ The interactive console on the error pages lets you execute code where the
71
+ exception originated. It's quite handy to introspect the state that led to the
72
+ error.
73
+
74
+ The `console` view helper launches an interactive console within the context of
75
+ the view where it is invoked.
76
+
77
+ Finally, you can launch a VT100 terminal that runs `rails console`. If you need
78
+ to create or modify existing test data, you can do that straight from the
79
+ browser.
80
+
81
+ ### Foreign key support
82
+
83
+ The migration DSL now supports adding and removing foreign keys. They are dumped
84
+ to `schema.rb` as well. At this time, only the `mysql`, `mysql2` and `postgresql`
85
+ adapters support foreign keys.
86
+
87
+ ```ruby
88
+ # add a foreign key to `articles.author_id` referencing `authors.id`
89
+ add_foreign_key :articles, :authors
90
+
91
+ # add a foreign key to `articles.author_id` referencing `users.lng_id`
92
+ add_foreign_key :articles, :users, column: :author_id, primary_key: "lng_id"
93
+
94
+ # remove the foreign key on `accounts.branch_id`
95
+ remove_foreign_key :accounts, :branches
96
+
97
+ # remove the foreign key on `accounts.owner_id`
98
+ remove_foreign_key :accounts, column: :owner_id
99
+ ```
100
+
101
+ See the API documentation on
102
+ [add_foreign_key](http://api.rubyonrails.org/v4.2.0/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_foreign_key)
103
+ and
104
+ [remove_foreign_key](http://api.rubyonrails.org/v4.2.0/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-remove_foreign_key)
105
+ for a full description.
106
+
107
+
108
+ Incompatibilities
109
+ -----------------
110
+
111
+ Previously deprecated functionality has been removed. Please refer to the
112
+ individual components for new deprecations in this release.
113
+
114
+ The following changes may require immediate action upon upgrade.
115
+
116
+ ### `respond_with` / class-level `respond_to`
117
+
118
+ `respond_with` and the corresponding class-level `respond_to` have been moved to
119
+ the `responders` gem. To use the following, add `gem 'responders', '~> 2.0'` to
120
+ your Gemfile:
121
+
122
+ ```ruby
123
+ # app/controllers/users_controller.rb
124
+
125
+ class UsersController < ApplicationController
126
+ respond_to :html, :json
127
+
128
+ def show
129
+ @user = User.find(params[:id])
130
+ respond_with @user
131
+ end
132
+ end
133
+ ```
134
+
135
+ Instance-level `respond_to` is unaffected:
136
+
137
+ ```ruby
138
+ # app/controllers/users_controller.rb
139
+
140
+ class UsersController < ApplicationController
141
+ def show
142
+ @user = User.find(params[:id])
143
+ respond_to do |format|
144
+ format.html
145
+ format.json { render json: @user }
146
+ end
147
+ end
148
+ end
149
+ ```
150
+
151
+ ### Production logging
152
+
153
+ The default log level in the `production` environment is now `:debug`. This
154
+ makes it consistent with the other environments, and ensures plenty of
155
+ information is available to diagnose problems.
156
+
157
+ It can be returned to the previous level, `:info`, in the environment
158
+ configuration:
159
+
160
+ ```ruby
161
+ # config/environments/production.rb
162
+
163
+ # Decrease the log volume.
164
+ config.log_level = :info
165
+ ```
166
+
167
+ ### HTML Sanitizer
168
+
169
+ The HTML sanitizer has been replaced with a new, more robust, implementation
170
+ built upon Loofah and Nokogiri. The new sanitizer is more secure and its
171
+ sanitization is more powerful and flexible.
172
+
173
+ With a new sanitization algorithm, the sanitized output will change for certain
174
+ pathological inputs.
175
+
176
+ If you have particular need for the exact output of the old sanitizer, you can
177
+ add `rails-deprecated_sanitizer` to your Gemfile, and it will automatically
178
+ replace the new implementation. Because it is opt-in, the legacy gem will not
179
+ give deprecation warnings.
180
+
181
+ `rails-deprecated_sanitizer` will be supported for Rails 4.2 only; it will not
182
+ be maintained for Rails 5.0.
183
+
184
+ See [the blog post](http://blog.plataformatec.com.br/2014/07/the-new-html-sanitizer-in-rails-4-2/)
185
+ for more detail on the changes in the new sanitizer.
186
+
187
+ ### `assert_select`
188
+
189
+ `assert_select` is now based on Nokogiri, making it (TODO: betterer).
190
+
191
+ As a result, some previously-valid selectors are now unsupported. If your
192
+ application is using any of these spellings, you will need to update them:
193
+
194
+ * Values in attribute selectors may need to be quoted if they contain
195
+ non-alphanumeric characters.
196
+
197
+ ```
198
+ a[href=/] => a[href="/"]
199
+ a[href$=/] => a[href$="/"]
200
+ ```
201
+
202
+ * DOMs built from HTML source containing invalid HTML with improperly
203
+ nested elements may differ.
204
+
205
+ For example:
206
+
207
+ ``` ruby
208
+ # content: <div><i><p></i></div>
209
+
210
+ # before:
211
+ assert_select('div > i') # => true
212
+ assert_select('div > p') # => false
213
+ assert_select('i > p') # => true
214
+
215
+ # now:
216
+ assert_select('div > i') # => true
217
+ assert_select('div > p') # => true
218
+ assert_select('i > p') # => false
219
+ ```
220
+
221
+ * If the data selected contains entities, the value selected for comparison
222
+ used to be raw (e.g. `AT&amp;T`), and now is evaluated
223
+ (e.g. `AT&T`).
224
+
225
+ ``` ruby
226
+ # content: <p>AT&amp;T</p>
227
+
228
+ # before:
229
+ assert_select('p', 'AT&amp;T') # => true
230
+ assert_select('p', 'AT&T') # => false
231
+
232
+ # now:
233
+ assert_select('p', 'AT&T') # => true
234
+ assert_select('p', 'AT&amp;T') # => false
235
+ ```
236
+
237
+
238
+ Railties
239
+ --------
240
+
241
+ Please refer to the [Changelog][railties] for detailed changes.
242
+
243
+ ### Removals
244
+
245
+ * The `rails application` command has been removed without replacement.
246
+ ([Pull Request](https://github.com/rails/rails/pull/11616))
247
+
248
+ ### Deprecations
249
+
250
+ * Deprecated `Rails::Rack::LogTailer` without replacement.
251
+ ([Commit](https://github.com/rails/rails/commit/84a13e019e93efaa8994b3f8303d635a7702dbce))
252
+
253
+ ### Notable changes
254
+
255
+ * Introduced `web-console` in the default application Gemfile.
256
+ ([Pull Request](https://github.com/rails/rails/pull/11667))
257
+
258
+ * Added a `required` option to the model generator for associations.
259
+ ([Pull Request](https://github.com/rails/rails/pull/16062))
260
+
261
+ * Introduced an `after_bundle` callback for use in Rails templates.
262
+ ([Pull Request](https://github.com/rails/rails/pull/16359))
263
+
264
+ * Introduced the `x` namespace for defining custom configuration options:
265
+
266
+ ```ruby
267
+ # config/environments/production.rb
268
+ config.x.payment_processing.schedule = :daily
269
+ config.x.payment_processing.retries = 3
270
+ config.x.super_debugger = true
271
+ ```
272
+
273
+ These options are then available through the configuration object:
274
+
275
+ ```ruby
276
+ Rails.configuration.x.payment_processing.schedule # => :daily
277
+ Rails.configuration.x.payment_processing.retries # => 3
278
+ Rails.configuration.x.super_debugger # => true
279
+ ```
280
+
281
+ ([Commit](https://github.com/rails/rails/commit/611849772dd66c2e4d005dcfe153f7ce79a8a7db))
282
+
283
+ * Introduced `Rails::Application.config_for` to load a configuration for the
284
+ current environment.
285
+
286
+ ```ruby
287
+ # config/exception_notification.yml:
288
+ production:
289
+ url: http://127.0.0.1:8080
290
+ namespace: my_app_production
291
+ development:
292
+ url: http://localhost:3001
293
+ namespace: my_app_development
294
+
295
+ # config/production.rb
296
+ MyApp::Application.configure do
297
+ config.middleware.use ExceptionNotifier, config_for(:exception_notification)
298
+ end
299
+ ```
300
+
301
+ ([Pull Request](https://github.com/rails/rails/pull/16129))
302
+
303
+ * Introduced a `--skip-gems` option in the app generator to skip gems such as
304
+ `turbolinks` and `coffee-rails` that do not have their own specific flags.
305
+ ([Commit](https://github.com/rails/rails/commit/10565895805887d4faf004a6f71219da177f78b7))
306
+
307
+ * Introduced a `bin/setup` script to enable automated setup code when
308
+ bootstrapping an application.
309
+ ([Pull Request](https://github.com/rails/rails/pull/15189))
310
+
311
+ * Changed default value for `config.assets.digest` to `true` in development.
312
+ ([Pull Request](https://github.com/rails/rails/pull/15155))
313
+
314
+ * Introduced an API to register new extensions for `rake notes`.
315
+ ([Pull Request](https://github.com/rails/rails/pull/14379))
316
+
317
+ * Introduced `Rails.gem_version` as a convenience method to return
318
+ `Gem::Version.new(Rails.version)`.
319
+ ([Pull Request](https://github.com/rails/rails/pull/14101))
320
+
321
+
322
+ Action Pack
323
+ -----------
324
+
325
+ Please refer to the [Changelog][action-pack] for detailed changes.
326
+
327
+ ### Removals
328
+
329
+ * `respond_with` and the class-level `respond_to` were removed from Rails and
330
+ moved to the `responders` gem (version 2.0). Add `gem 'responders', '~> 2.0'`
331
+ to your `Gemfile` to continue using these features.
332
+ ([Pull Request](https://github.com/rails/rails/pull/16526))
333
+
334
+ * Removed deprecated `AbstractController::Helpers::ClassMethods::MissingHelperError`
335
+ in favor of `AbstractController::Helpers::MissingHelperError`.
336
+ ([Commit](https://github.com/rails/rails/commit/a1ddde15ae0d612ff2973de9cf768ed701b594e8))
337
+
338
+ ### Deprecations
339
+
340
+ * Deprecated `assert_tag`, `assert_no_tag`, `find_tag` and `find_all_tag` in
341
+ favor of `assert_select`.
342
+ ([Commit](https://github.com/rails/rails-dom-testing/commit/b12850bc5ff23ba4b599bf2770874dd4f11bf750))
343
+
344
+ * Deprecated support for setting the `:to` option of a router to a symbol or a
345
+ string that does not contain a `#` character:
346
+
347
+ ```ruby
348
+ get '/posts', to: MyRackApp => (No change necessary)
349
+ get '/posts', to: 'post#index' => (No change necessary)
350
+ get '/posts', to: 'posts' => get '/posts', controller: :posts
351
+ get '/posts', to: :index => get '/posts', action: :index
352
+ ```
353
+
354
+ ([Commit](https://github.com/rails/rails/commit/cc26b6b7bccf0eea2e2c1a9ebdcc9d30ca7390d9))
355
+
356
+ ### Notable changes
357
+
358
+ * Rails will now automatically include the template's digest in ETags.
359
+ ([Pull Request](https://github.com/rails/rails/pull/16527))
360
+
361
+ * `render nothing: true` or rendering a `nil` body no longer add a single
362
+ space padding to the response body.
363
+ ([Pull Request](https://github.com/rails/rails/pull/14883))
364
+
365
+ * Introduced the `always_permitted_parameters` option to configure which
366
+ parameters are permitted globally. The default value of this configuration
367
+ is `['controller', 'action']`.
368
+ ([Pull Request](https://github.com/rails/rails/pull/15933))
369
+
370
+ * The `*_filter` family methods have been removed from the documentation. Their
371
+ usage is discouraged in favor of the `*_action` family methods:
372
+
373
+ ```
374
+ after_filter => after_action
375
+ append_after_filter => append_after_action
376
+ append_around_filter => append_around_action
377
+ append_before_filter => append_before_action
378
+ around_filter => around_action
379
+ before_filter => before_action
380
+ prepend_after_filter => prepend_after_action
381
+ prepend_around_filter => prepend_around_action
382
+ prepend_before_filter => prepend_before_action
383
+ skip_after_filter => skip_after_action
384
+ skip_around_filter => skip_around_action
385
+ skip_before_filter => skip_before_action
386
+ skip_filter => skip_action_callback
387
+ ```
388
+
389
+ If your application currently depends on these methods, you should use the
390
+ replacement `*_action` methods instead. These methods will be deprecated in
391
+ the future and will eventually be removed from Rails.
392
+
393
+ (Commit [1](https://github.com/rails/rails/commit/6c5f43bab8206747a8591435b2aa0ff7051ad3de),
394
+ [2](https://github.com/rails/rails/commit/489a8f2a44dc9cea09154ee1ee2557d1f037c7d4))
395
+
396
+ * Added HTTP method `MKCALENDAR` from RFC-4791
397
+ ([Pull Request](https://github.com/rails/rails/pull/15121))
398
+
399
+ * `*_fragment.action_controller` notifications now include the controller
400
+ and action name in the payload.
401
+ ([Pull Request](https://github.com/rails/rails/pull/14137))
402
+
403
+ * Segments that are passed into URL helpers are now automatically escaped.
404
+ ([Commit](https://github.com/rails/rails/commit/5460591f0226a9d248b7b4f89186bd5553e7768f))
405
+
406
+ * Improved the Routing Error page with fuzzy matching for route search.
407
+ ([Pull Request](https://github.com/rails/rails/pull/14619))
408
+
409
+ * Added an option to disable logging of CSRF failures.
410
+ ([Pull Request](https://github.com/rails/rails/pull/14280))
411
+
412
+ * When the Rails server is set to serve static assets, gzip assets will now be
413
+ served if the client supports it and a pre-generated gzip file (.gz) is on disk.
414
+ By default the asset pipeline generates `.gz` files for all compressible assets.
415
+ Serving gzip files minimizes data transfer and speeds up asset requests. Always
416
+ [use a CDN](http://guides.rubyonrails.org/asset_pipeline.html#cdns) if you are
417
+ serving assets from your Rails server in production.
418
+ ([Pull Request](https://github.com/rails/rails/pull/16466))
419
+
420
+ * The way `assert_select` works has changed; specifically a different library
421
+ is used to interpret css selectors, build the transient DOM that the
422
+ selectors are applied against, and to extract the data from that DOM. These
423
+ changes should only affect edge cases. Examples:
424
+ * Values in attribute selectors may need to be quoted if they contain
425
+ non-alphanumeric characters.
426
+ * DOMs built from HTML source containing invalid HTML with improperly
427
+ nested elements may differ.
428
+ * If the data selected contains entities, the value selected for comparison
429
+ used to be raw (e.g. `AT&amp;T`), and now is evaluated
430
+ (e.g. `AT&T`).
431
+
432
+
433
+ Action View
434
+ -------------
435
+
436
+ Please refer to the [Changelog][action-view] for detailed changes.
437
+
438
+ ### Deprecations
439
+
440
+ * Deprecated `AbstractController::Base.parent_prefixes`.
441
+ Override `AbstractController::Base.local_prefixes` when you want to change
442
+ where to find views.
443
+ ([Pull Request](https://github.com/rails/rails/pull/15026))
444
+
445
+ * Deprecated `ActionView::Digestor#digest(name, format, finder, options = {})`.
446
+ Arguments should be passed as a hash instead.
447
+ ([Pull Request](https://github.com/rails/rails/pull/14243))
448
+
449
+ ### Notable changes
450
+
451
+ * Introduced a `#{partial_name}_iteration` special local variable for use with
452
+ partials that are rendered with a collection. It provides access to the
453
+ current state of the iteration via the `#index`, `#size`, `#first?` and
454
+ `#last?` methods.
455
+ ([Pull Request](https://github.com/rails/rails/pull/7698))
456
+
457
+ * The form helpers no longer generate a `<div>` element with inline CSS around
458
+ the hidden fields.
459
+ ([Pull Request](https://github.com/rails/rails/pull/14738))
460
+
461
+ * Placeholder I18n follows the same convention as `label` I18n.
462
+ ([Pull Request](https://github.com/rails/rails/pull/16438))
463
+
464
+
465
+ Action Mailer
466
+ -------------
467
+
468
+ Please refer to the [Changelog][action-mailer] for detailed changes.
469
+
470
+ ### Deprecations
471
+
472
+ * Deprecated `*_path` helpers in mailers. Always use `*_url` helpers instead.
473
+ ([Pull Request](https://github.com/rails/rails/pull/15840))
474
+
475
+ * Deprecated `deliver` / `deliver!` in favour of `deliver_now` / `deliver_now!`.
476
+ ([Pull Request](https://github.com/rails/rails/pull/16582))
477
+
478
+ ### Notable changes
479
+
480
+ * Introduced `deliver_later` which enqueues a job on the application's queue
481
+ to deliver emails asynchronously.
482
+ ([Pull Request](https://github.com/rails/rails/pull/16485))
483
+
484
+ * Added the `show_previews` configuration option for enabling mailer previews
485
+ outside of the development environment.
486
+ ([Pull Request](https://github.com/rails/rails/pull/15970))
487
+
488
+
489
+ Active Record
490
+ -------------
491
+
492
+ Please refer to the [Changelog][active-record] for detailed changes.
493
+
494
+ ### Removals
495
+
496
+ * Removed `cache_attributes` and friends. All attributes are cached.
497
+ ([Pull Request](https://github.com/rails/rails/pull/15429))
498
+
499
+ * Removed deprecated method `ActiveRecord::Base.quoted_locking_column`.
500
+ ([Pull Request](https://github.com/rails/rails/pull/15612))
501
+
502
+ * Removed deprecated `ActiveRecord::Migrator.proper_table_name`. Use the
503
+ `proper_table_name` instance method on `ActiveRecord::Migration` instead.
504
+ ([Pull Request](https://github.com/rails/rails/pull/15512))
505
+
506
+ * Removed unused `:timestamp` type. Transparently alias it to `:datetime`
507
+ in all cases. Fixes inconsistencies when column types are sent outside of
508
+ `ActiveRecord`, such as for XML serialization.
509
+ ([Pull Request](https://github.com/rails/rails/pull/15184))
510
+
511
+ ### Deprecations
512
+
513
+ * Deprecated swallowing of errors inside `after_commit` and `after_rollback`.
514
+ ([Pull Request](https://github.com/rails/rails/pull/16537))
515
+
516
+ * Deprecated calling `DatabaseTasks.load_schema` without a connection. Use
517
+ `DatabaseTasks.load_schema_current` instead.
518
+ ([Commit](https://github.com/rails/rails/commit/f15cef67f75e4b52fd45655d7c6ab6b35623c608))
519
+
520
+ * Deprecated `Reflection#source_macro` without replacement as it is no longer
521
+ needed in Active Record.
522
+ ([Pull Request](https://github.com/rails/rails/pull/16373))
523
+
524
+ * Deprecated broken support for automatic detection of counter caches on
525
+ `has_many :through` associations. You should instead manually specify the
526
+ counter cache on the `has_many` and `belongs_to` associations for the
527
+ through records.
528
+ ([Pull Request](https://github.com/rails/rails/pull/15754))
529
+
530
+ * Deprecated `serialized_attributes` without replacement.
531
+ ([Pull Request](https://github.com/rails/rails/pull/15704))
532
+
533
+ * Deprecated returning `nil` from `column_for_attribute` when no column
534
+ exists. It will return a null object in Rails 5.0
535
+ ([Pull Request](https://github.com/rails/rails/pull/15878))
536
+
537
+ * Deprecated using `.joins`, `.preload` and `.eager_load` with associations
538
+ that depends on the instance state (i.e. those defined with a scope that
539
+ takes an argument) without replacement.
540
+ ([Commit](https://github.com/rails/rails/commit/ed56e596a0467390011bc9d56d462539776adac1))
541
+
542
+ * Deprecated passing Active Record objects to `.find` or `.exists?`. Call
543
+ `#id` on the objects first.
544
+ (Commit [1](https://github.com/rails/rails/commit/d92ae6ccca3bcfd73546d612efaea011270bd270),
545
+ [2](https://github.com/rails/rails/commit/d35f0033c7dec2b8d8b52058fb8db495d49596f7))
546
+
547
+ * Deprecated half-baked support for PostgreSQL range values with excluding
548
+ beginnings. We currently map PostgreSQL ranges to Ruby ranges. This conversion
549
+ is not fully possible because the Ruby range does not support excluded
550
+ beginnings.
551
+
552
+ The current solution of incrementing the beginning is not correct
553
+ and is now deprecated. For subtypes where we don't know how to increment
554
+ (e.g. `#succ` is not defined) it will raise an `ArgumentError` for ranges
555
+ with excluding beginnings.
556
+
557
+ ([Commit](https://github.com/rails/rails/commit/91949e48cf41af9f3e4ffba3e5eecf9b0a08bfc3))
558
+
559
+ ### Notable changes
560
+
561
+ * The PostgreSQL adapter now supports the `JSONB` datatype in PostgreSQL 9.4+.
562
+ ([Pull Request](https://github.com/rails/rails/pull/16220))
563
+
564
+ * The `#references` method in migrations now supports a `type` option for
565
+ specifying the type of the foreign key (e.g. `:uuid`).
566
+ ([Pull Request](https://github.com/rails/rails/pull/16231))
567
+
568
+ * Added a `:required` option to singular associations, which defines a
569
+ presence validation on the association.
570
+ ([Pull Request](https://github.com/rails/rails/pull/16056))
571
+
572
+ * Introduced `ActiveRecord::Base#validate!` that raises `RecordInvalid` if the
573
+ record is invalid.
574
+ ([Pull Request](https://github.com/rails/rails/pull/8639))
575
+
576
+ * `ActiveRecord::Base#reload` now behaves the same as `m = Model.find(m.id)`,
577
+ meaning that it no longer retains the extra attributes from custom
578
+ `select`s.
579
+ ([Pull Request](https://github.com/rails/rails/pull/15866))
580
+
581
+ * Introduced the `bin/rake db:purge` task to empty the database for the
582
+ current environment.
583
+ ([Commit](https://github.com/rails/rails/commit/e2f232aba15937a4b9d14bd91e0392c6d55be58d))
584
+
585
+ * `ActiveRecord::Dirty` now detects in-place changes to mutable values.
586
+ Serialized attributes on ActiveRecord models will no longer save when
587
+ unchanged. This also works with other types such as string columns and json
588
+ columns on PostgreSQL.
589
+ (Pull Requests [1](https://github.com/rails/rails/pull/15674),
590
+ [2](https://github.com/rails/rails/pull/15786),
591
+ [3](https://github.com/rails/rails/pull/15788))
592
+
593
+ * Added support for `#pretty_print` in `ActiveRecord::Base` objects.
594
+ ([Pull Request](https://github.com/rails/rails/pull/15172))
595
+
596
+ * PostgreSQL and SQLite adapters no longer add a default limit of 255
597
+ characters on string columns.
598
+ ([Pull Request](https://github.com/rails/rails/pull/14579))
599
+
600
+ * `sqlite3:///some/path` now resolves to the absolute system path
601
+ `/some/path`. For relative paths, use `sqlite3:some/path` instead.
602
+ (Previously, `sqlite3:///some/path` resolved to the relative path
603
+ `some/path`. This behaviour was deprecated on Rails 4.1).
604
+ ([Pull Request](https://github.com/rails/rails/pull/14569))
605
+
606
+ * Introduced `#validate` as an alias for `#valid?`.
607
+ ([Pull Request](https://github.com/rails/rails/pull/14456))
608
+
609
+ * `#touch` now accepts multiple attributes to be touched at once.
610
+ ([Pull Request](https://github.com/rails/rails/pull/14423))
611
+
612
+ * Added support for fractional seconds for MySQL 5.6 and above.
613
+ (Pull Request [1](https://github.com/rails/rails/pull/8240),
614
+ [2](https://github.com/rails/rails/pull/14359))
615
+
616
+ * Added support for the `citext` column type in PostgreSQL adapter.
617
+ ([Pull Request](https://github.com/rails/rails/pull/12523))
618
+
619
+ * Added support for user-created range types in PostgreSQL adapter.
620
+ ([Commit](https://github.com/rails/rails/commit/4cb47167e747e8f9dc12b0ddaf82bdb68c03e032))
621
+
622
+
623
+ Active Model
624
+ ------------
625
+
626
+ Please refer to the [Changelog][active-model] for detailed changes.
627
+
628
+ ### Removals
629
+
630
+ * Removed deprecated `Validator#setup` without replacement.
631
+ ([Pull Request](https://github.com/rails/rails/pull/10716))
632
+
633
+ ### Deprecations
634
+
635
+ * Deprecated `reset_#{attribute}` in favor of `restore_#{attribute}`.
636
+ ([Pull Request](https://github.com/rails/rails/pull/16180))
637
+
638
+ * Deprecated `ActiveModel::Dirty#reset_changes` in favor of
639
+ `#clear_changes_information`.
640
+ ([Pull Request](https://github.com/rails/rails/pull/16180))
641
+
642
+ ### Notable changes
643
+
644
+ * Introduced the `restore_attributes` method in `ActiveModel::Dirty` to restore
645
+ the changed (dirty) attributes to their previous values.
646
+ (Pull Request [1](https://github.com/rails/rails/pull/14861),
647
+ [2](https://github.com/rails/rails/pull/16180))
648
+
649
+ * `has_secure_password` no longer disallow blank passwords (i.e. passwords
650
+ that contains only spaces) by default.
651
+ ([Pull Request](https://github.com/rails/rails/pull/16412))
652
+
653
+ * `has_secure_password` now verifies that the given password is less than 72
654
+ characters if validations are enabled.
655
+ ([Pull Request](https://github.com/rails/rails/pull/15708))
656
+
657
+ * Introduced `#validate` as an alias for `#valid?`.
658
+ ([Pull Request](https://github.com/rails/rails/pull/14456))
659
+
660
+
661
+ Active Support
662
+ --------------
663
+
664
+ Please refer to the [Changelog][active-support] for detailed changes.
665
+
666
+ ### Removals
667
+
668
+ * Removed deprecated `Numeric#ago`, `Numeric#until`, `Numeric#since`,
669
+ `Numeric#from_now`.
670
+ ([Commit](https://github.com/rails/rails/commit/f1eddea1e3f6faf93581c43651348f48b2b7d8bb))
671
+
672
+ * Removed deprecated string based terminators for `ActiveSupport::Callbacks`.
673
+ ([Pull Request](https://github.com/rails/rails/pull/15100))
674
+
675
+ ### Deprecations
676
+
677
+ * Deprecated `Kernel#silence_stderr`, `Kernel#capture` and `Kernel#quietly`
678
+ without replacement.
679
+ ([Pull Request](https://github.com/rails/rails/pull/13392))
680
+
681
+ * Deprecated `Class#superclass_delegating_accessor`, use
682
+ `Class#class_attribute` instead.
683
+ ([Pull Request](https://github.com/rails/rails/pull/14271))
684
+
685
+ * Deprecated `ActiveSupport::SafeBuffer#prepend!` as
686
+ `ActiveSupport::SafeBuffer#prepend` now performs the same function.
687
+ ([Pull Request](https://github.com/rails/rails/pull/14529))
688
+
689
+ ### Notable changes
690
+
691
+ * The `travel_to` test helper now truncates the `usec` component to 0.
692
+ ([Commit](https://github.com/rails/rails/commit/9f6e82ee4783e491c20f5244a613fdeb4024beb5))
693
+
694
+ * `ActiveSupport::TestCase` now randomizes the order that test cases are ran
695
+ by default.
696
+ ([Commit](https://github.com/rails/rails/commit/6ffb29d24e05abbd9ffe3ea974140d6c70221807))
697
+
698
+ * Introduced `Object#itself` as an identity function.
699
+ (Commit [1](https://github.com/rails/rails/commit/702ad710b57bef45b081ebf42e6fa70820fdd810),
700
+ [2](https://github.com/rails/rails/commit/64d91122222c11ad3918cc8e2e3ebc4b0a03448a))
701
+
702
+ * `Object#with_options` can now be used without an explicit receiver.
703
+ ([Pull Request](https://github.com/rails/rails/pull/16339))
704
+
705
+ * Introduced `String#truncate_words` to truncate a string by a number of words.
706
+ ([Pull Request](https://github.com/rails/rails/pull/16190))
707
+
708
+ * Added `Hash#transform_values` and `Hash#transform_values!` to simplify a
709
+ common pattern where the values of a hash must change, but the keys are left
710
+ the same.
711
+ ([Pull Request](https://github.com/rails/rails/pull/15819))
712
+
713
+ * The `humanize` inflector helper now strips any leading underscores.
714
+ ([Commit](https://github.com/rails/rails/commit/daaa21bc7d20f2e4ff451637423a25ff2d5e75c7))
715
+
716
+ * Introduced `Concern#class_methods` as an alternative to
717
+ `module ClassMethods`, as well as `Kernel#concern` to avoid the
718
+ `module Foo; extend ActiveSupport::Concern; end` boilerplate.
719
+ ([Commit](https://github.com/rails/rails/commit/b16c36e688970df2f96f793a759365b248b582ad))
720
+
721
+
722
+ Credits
723
+ -------
724
+
725
+ See the
726
+ [full list of contributors to Rails](http://contributors.rubyonrails.org/) for
727
+ the many people who spent many hours making Rails the stable and robust
728
+ framework it is today. Kudos to all of them.
729
+
730
+ [railties]: https://github.com/rails/rails/blob/4-2-stable/railties/CHANGELOG.md
731
+ [action-pack]: https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md
732
+ [action-view]: https://github.com/rails/rails/blob/4-2-stable/actionview/CHANGELOG.md
733
+ [action-mailer]: https://github.com/rails/rails/blob/4-2-stable/actionmailer/CHANGELOG.md
734
+ [active-record]: https://github.com/rails/rails/blob/4-2-stable/activerecord/CHANGELOG.md
735
+ [active-model]: https://github.com/rails/rails/blob/4-2-stable/activemodel/CHANGELOG.md
736
+ [active-support]: https://github.com/rails/rails/blob/4-2-stable/activesupport/CHANGELOG.md