rails 4.2.0.beta3 → 4.2.0.beta4

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 (227) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -7
  3. data/guides/output/2_2_release_notes.html +724 -0
  4. data/guides/output/2_3_release_notes.html +870 -0
  5. data/guides/output/3_0_release_notes.html +773 -0
  6. data/guides/output/3_1_release_notes.html +740 -0
  7. data/guides/output/3_2_release_notes.html +797 -0
  8. data/guides/output/4_0_release_notes.html +523 -0
  9. data/guides/output/4_1_release_notes.html +806 -0
  10. data/guides/output/4_2_release_notes.html +728 -0
  11. data/guides/output/Gemfile +6 -0
  12. data/guides/output/_license.html +226 -0
  13. data/guides/output/_welcome.html +233 -0
  14. data/guides/output/action_controller_overview.html +1335 -0
  15. data/guides/output/action_mailer_basics.html +928 -0
  16. data/guides/output/action_view_overview.html +1509 -0
  17. data/guides/output/active_job_basics.html +546 -0
  18. data/guides/output/active_model_basics.html +438 -0
  19. data/guides/output/active_record_basics.html +594 -0
  20. data/guides/output/active_record_callbacks.html +592 -0
  21. data/guides/output/active_record_migrations.html +1123 -0
  22. data/guides/output/active_record_postgresql.html +675 -0
  23. data/guides/output/active_record_querying.html +1796 -0
  24. data/guides/output/active_record_validations.html +1301 -0
  25. data/guides/output/active_support_core_extensions.html +3450 -0
  26. data/guides/output/active_support_instrumentation.html +1121 -0
  27. data/guides/output/api_documentation_guidelines.html +498 -0
  28. data/guides/output/asset_pipeline.html +1167 -0
  29. data/guides/output/association_basics.html +2086 -0
  30. data/guides/output/caching_with_rails.html +553 -0
  31. data/guides/output/command_line.html +791 -0
  32. data/guides/output/configuring.html +1055 -0
  33. data/guides/output/contributing_to_ruby_on_rails.html +657 -0
  34. data/guides/output/credits.html +284 -0
  35. data/guides/output/debugging_rails_applications.html +1014 -0
  36. data/guides/output/development_dependencies_install.html +478 -0
  37. data/guides/output/engines.html +1438 -0
  38. data/guides/output/form_helpers.html +1074 -0
  39. data/guides/output/generators.html +838 -0
  40. data/guides/output/getting_started.html +2092 -0
  41. data/guides/output/i18n.html +1198 -0
  42. data/guides/output/images/akshaysurve.jpg +0 -0
  43. data/guides/output/images/belongs_to.png +0 -0
  44. data/guides/output/images/book_icon.gif +0 -0
  45. data/guides/output/images/bullet.gif +0 -0
  46. data/guides/output/images/chapters_icon.gif +0 -0
  47. data/guides/output/images/check_bullet.gif +0 -0
  48. data/guides/output/images/credits_pic_blank.gif +0 -0
  49. data/guides/output/images/csrf.png +0 -0
  50. data/guides/output/images/edge_badge.png +0 -0
  51. data/guides/output/images/favicon.ico +0 -0
  52. data/guides/output/images/feature_tile.gif +0 -0
  53. data/guides/output/images/footer_tile.gif +0 -0
  54. data/guides/output/images/fxn.png +0 -0
  55. data/guides/output/images/getting_started/article_with_comments.png +0 -0
  56. data/guides/output/images/getting_started/challenge.png +0 -0
  57. data/guides/output/images/getting_started/confirm_dialog.png +0 -0
  58. data/guides/output/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
  59. data/guides/output/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
  60. data/guides/output/images/getting_started/form_with_errors.png +0 -0
  61. data/guides/output/images/getting_started/index_action_with_edit_link.png +0 -0
  62. data/guides/output/images/getting_started/new_article.png +0 -0
  63. data/guides/output/images/getting_started/new_post.png +0 -0
  64. data/guides/output/images/getting_started/post_with_comments.png +0 -0
  65. data/guides/output/images/getting_started/rails_welcome.png +0 -0
  66. data/guides/output/images/getting_started/routing_error_no_controller.png +0 -0
  67. data/guides/output/images/getting_started/routing_error_no_route_matches.png +0 -0
  68. data/guides/output/images/getting_started/show_action_for_articles.png +0 -0
  69. data/guides/output/images/getting_started/show_action_for_posts.png +0 -0
  70. data/guides/output/images/getting_started/template_is_missing_articles_new.png +0 -0
  71. data/guides/output/images/getting_started/template_is_missing_posts_new.png +0 -0
  72. data/guides/output/images/getting_started/undefined_method_post_path.png +0 -0
  73. data/guides/output/images/getting_started/unknown_action_create_for_articles.png +0 -0
  74. data/guides/output/images/getting_started/unknown_action_create_for_posts.png +0 -0
  75. data/guides/output/images/getting_started/unknown_action_new_for_articles.png +0 -0
  76. data/guides/output/images/getting_started/unknown_action_new_for_posts.png +0 -0
  77. data/guides/output/images/grey_bullet.gif +0 -0
  78. data/guides/output/images/habtm.png +0 -0
  79. data/guides/output/images/has_many.png +0 -0
  80. data/guides/output/images/has_many_through.png +0 -0
  81. data/guides/output/images/has_one.png +0 -0
  82. data/guides/output/images/has_one_through.png +0 -0
  83. data/guides/output/images/header_backdrop.png +0 -0
  84. data/guides/output/images/header_tile.gif +0 -0
  85. data/guides/output/images/i18n/demo_html_safe.png +0 -0
  86. data/guides/output/images/i18n/demo_localized_pirate.png +0 -0
  87. data/guides/output/images/i18n/demo_translated_en.png +0 -0
  88. data/guides/output/images/i18n/demo_translated_pirate.png +0 -0
  89. data/guides/output/images/i18n/demo_translation_missing.png +0 -0
  90. data/guides/output/images/i18n/demo_untranslated.png +0 -0
  91. data/guides/output/images/icons/README +5 -0
  92. data/guides/output/images/icons/callouts/1.png +0 -0
  93. data/guides/output/images/icons/callouts/10.png +0 -0
  94. data/guides/output/images/icons/callouts/11.png +0 -0
  95. data/guides/output/images/icons/callouts/12.png +0 -0
  96. data/guides/output/images/icons/callouts/13.png +0 -0
  97. data/guides/output/images/icons/callouts/14.png +0 -0
  98. data/guides/output/images/icons/callouts/15.png +0 -0
  99. data/guides/output/images/icons/callouts/2.png +0 -0
  100. data/guides/output/images/icons/callouts/3.png +0 -0
  101. data/guides/output/images/icons/callouts/4.png +0 -0
  102. data/guides/output/images/icons/callouts/5.png +0 -0
  103. data/guides/output/images/icons/callouts/6.png +0 -0
  104. data/guides/output/images/icons/callouts/7.png +0 -0
  105. data/guides/output/images/icons/callouts/8.png +0 -0
  106. data/guides/output/images/icons/callouts/9.png +0 -0
  107. data/guides/output/images/icons/caution.png +0 -0
  108. data/guides/output/images/icons/example.png +0 -0
  109. data/guides/output/images/icons/home.png +0 -0
  110. data/guides/output/images/icons/important.png +0 -0
  111. data/guides/output/images/icons/next.png +0 -0
  112. data/guides/output/images/icons/note.png +0 -0
  113. data/guides/output/images/icons/prev.png +0 -0
  114. data/guides/output/images/icons/tip.png +0 -0
  115. data/guides/output/images/icons/up.png +0 -0
  116. data/guides/output/images/icons/warning.png +0 -0
  117. data/guides/output/images/nav_arrow.gif +0 -0
  118. data/guides/output/images/oscardelben.jpg +0 -0
  119. data/guides/output/images/polymorphic.png +0 -0
  120. data/guides/output/images/radar.png +0 -0
  121. data/guides/output/images/rails4_features.png +0 -0
  122. data/guides/output/images/rails_guides_kindle_cover.jpg +0 -0
  123. data/guides/output/images/rails_guides_logo.gif +0 -0
  124. data/guides/output/images/rails_logo_remix.gif +0 -0
  125. data/guides/output/images/session_fixation.png +0 -0
  126. data/guides/output/images/tab_grey.gif +0 -0
  127. data/guides/output/images/tab_info.gif +0 -0
  128. data/guides/output/images/tab_note.gif +0 -0
  129. data/guides/output/images/tab_red.gif +0 -0
  130. data/guides/output/images/tab_yellow.gif +0 -0
  131. data/guides/output/images/tab_yellow.png +0 -0
  132. data/guides/output/images/vijaydev.jpg +0 -0
  133. data/guides/output/index.html +354 -0
  134. data/guides/output/initialization.html +876 -0
  135. data/guides/output/javascripts/guides.js +59 -0
  136. data/guides/output/javascripts/jquery.min.js +4 -0
  137. data/guides/output/javascripts/responsive-tables.js +43 -0
  138. data/guides/output/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
  139. data/guides/output/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
  140. data/guides/output/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
  141. data/guides/output/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
  142. data/guides/output/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
  143. data/guides/output/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
  144. data/guides/output/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
  145. data/guides/output/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
  146. data/guides/output/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
  147. data/guides/output/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
  148. data/guides/output/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
  149. data/guides/output/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
  150. data/guides/output/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
  151. data/guides/output/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
  152. data/guides/output/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
  153. data/guides/output/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
  154. data/guides/output/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
  155. data/guides/output/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
  156. data/guides/output/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
  157. data/guides/output/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
  158. data/guides/output/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
  159. data/guides/output/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
  160. data/guides/output/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
  161. data/guides/output/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
  162. data/guides/output/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
  163. data/guides/output/javascripts/syntaxhighlighter/shCore.js +17 -0
  164. data/guides/output/layout.html +448 -0
  165. data/guides/output/layouts_and_rendering.html +1541 -0
  166. data/guides/output/maintenance_policy.html +257 -0
  167. data/guides/output/migrations.html +1360 -0
  168. data/guides/output/nested_model_forms.html +412 -0
  169. data/guides/output/plugins.html +644 -0
  170. data/guides/output/rails_application_templates.html +450 -0
  171. data/guides/output/rails_on_rack.html +547 -0
  172. data/guides/output/routing.html +1631 -0
  173. data/guides/output/ruby_on_rails_guides_guidelines.html +329 -0
  174. data/guides/output/security.html +935 -0
  175. data/guides/output/stylesheets/fixes.css +16 -0
  176. data/guides/output/stylesheets/kindle.css +11 -0
  177. data/guides/output/stylesheets/main.css +713 -0
  178. data/guides/output/stylesheets/print.css +52 -0
  179. data/guides/output/stylesheets/reset.css +43 -0
  180. data/guides/output/stylesheets/responsive-tables.css +50 -0
  181. data/guides/output/stylesheets/style.css +13 -0
  182. data/guides/output/stylesheets/syntaxhighlighter/shCore.css +226 -0
  183. data/guides/output/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
  184. data/guides/output/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
  185. data/guides/output/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
  186. data/guides/output/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
  187. data/guides/output/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
  188. data/guides/output/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
  189. data/guides/output/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
  190. data/guides/output/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
  191. data/guides/output/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
  192. data/guides/output/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
  193. data/guides/output/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
  194. data/guides/output/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
  195. data/guides/output/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
  196. data/guides/output/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
  197. data/guides/output/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
  198. data/guides/output/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
  199. data/guides/output/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
  200. data/guides/output/testing.html +1350 -0
  201. data/guides/output/upgrading_ruby_on_rails.html +1135 -0
  202. data/guides/output/working_with_javascript_in_rails.html +587 -0
  203. data/guides/source/4_0_release_notes.md +2 -2
  204. data/guides/source/4_2_release_notes.md +9 -2
  205. data/guides/source/action_controller_overview.md +3 -1
  206. data/guides/source/action_mailer_basics.md +1 -2
  207. data/guides/source/active_job_basics.md +25 -2
  208. data/guides/source/active_model_basics.md +350 -19
  209. data/guides/source/active_record_basics.md +2 -2
  210. data/guides/source/active_record_migrations.md +1 -1
  211. data/guides/source/active_record_validations.md +12 -4
  212. data/guides/source/active_support_core_extensions.md +7 -9
  213. data/guides/source/active_support_instrumentation.md +2 -0
  214. data/guides/source/association_basics.md +7 -7
  215. data/guides/source/configuring.md +24 -0
  216. data/guides/source/contributing_to_ruby_on_rails.md +1 -1
  217. data/guides/source/credits.html.erb +1 -1
  218. data/guides/source/documents.yaml +5 -0
  219. data/guides/source/engines.md +2 -2
  220. data/guides/source/form_helpers.md +6 -0
  221. data/guides/source/i18n.md +6 -9
  222. data/guides/source/layouts_and_rendering.md +1 -1
  223. data/guides/source/plugins.md +2 -2
  224. data/guides/source/rails_on_rack.md +4 -0
  225. data/guides/source/testing.md +1 -0
  226. data/guides/source/upgrading_ruby_on_rails.md +5 -5
  227. metadata +227 -27
@@ -0,0 +1,806 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1"/>
7
+
8
+ <title>Ruby on Rails 4.1 Release Notes — Ruby on Rails Guides</title>
9
+ <link rel="stylesheet" type="text/css" href="stylesheets/style.css" />
10
+ <link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print" />
11
+
12
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shCore.css" />
13
+ <link rel="stylesheet" type="text/css" href="stylesheets/syntaxhighlighter/shThemeRailsGuides.css" />
14
+
15
+ <link rel="stylesheet" type="text/css" href="stylesheets/fixes.css" />
16
+
17
+ <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
18
+ </head>
19
+ <body class="guide">
20
+ <div id="topNav">
21
+ <div class="wrapper">
22
+ <strong class="more-info-label">More at <a href="http://rubyonrails.org/">rubyonrails.org:</a> </strong>
23
+ <span class="red-button more-info-button">
24
+ More Ruby on Rails
25
+ </span>
26
+ <ul class="more-info-links s-hidden">
27
+ <li class="more-info"><a href="http://rubyonrails.org/">Overview</a></li>
28
+ <li class="more-info"><a href="http://rubyonrails.org/download">Download</a></li>
29
+ <li class="more-info"><a href="http://rubyonrails.org/deploy">Deploy</a></li>
30
+ <li class="more-info"><a href="https://github.com/rails/rails">Code</a></li>
31
+ <li class="more-info"><a href="http://rubyonrails.org/screencasts">Screencasts</a></li>
32
+ <li class="more-info"><a href="http://rubyonrails.org/documentation">Documentation</a></li>
33
+ <li class="more-info"><a href="http://rubyonrails.org/community">Community</a></li>
34
+ <li class="more-info"><a href="http://weblog.rubyonrails.org/">Blog</a></li>
35
+ </ul>
36
+ </div>
37
+ </div>
38
+ <div id="header">
39
+ <div class="wrapper clearfix">
40
+ <h1><a href="index.html" title="Return to home page">Guides.rubyonrails.org</a></h1>
41
+ <ul class="nav">
42
+ <li><a class="nav-item" href="index.html">Home</a></li>
43
+ <li class="guides-index guides-index-large">
44
+ <a href="index.html" id="guidesMenu" class="guides-index-item nav-item">Guides Index</a>
45
+ <div id="guides" class="clearfix" style="display: none;">
46
+ <hr />
47
+ <dl class="L">
48
+ <dt>Start Here</dt>
49
+ <dd><a href="getting_started.html">Getting Started with Rails</a></dd>
50
+ <dt>Models</dt>
51
+ <dd><a href="active_record_basics.html">Active Record Basics</a></dd>
52
+ <dd><a href="active_record_migrations.html">Active Record Migrations</a></dd>
53
+ <dd><a href="active_record_validations.html">Active Record Validations</a></dd>
54
+ <dd><a href="active_record_callbacks.html">Active Record Callbacks</a></dd>
55
+ <dd><a href="association_basics.html">Active Record Associations</a></dd>
56
+ <dd><a href="active_record_querying.html">Active Record Query Interface</a></dd>
57
+ <dt>Views</dt>
58
+ <dd><a href="layouts_and_rendering.html">Layouts and Rendering in Rails</a></dd>
59
+ <dd><a href="form_helpers.html">Action View Form Helpers</a></dd>
60
+ <dt>Controllers</dt>
61
+ <dd><a href="action_controller_overview.html">Action Controller Overview</a></dd>
62
+ <dd><a href="routing.html">Rails Routing from the Outside In</a></dd>
63
+ </dl>
64
+ <dl class="R">
65
+ <dt>Digging Deeper</dt>
66
+ <dd><a href="active_support_core_extensions.html">Active Support Core Extensions</a></dd>
67
+ <dd><a href="i18n.html">Rails Internationalization API</a></dd>
68
+ <dd><a href="action_mailer_basics.html">Action Mailer Basics</a></dd>
69
+ <dd><a href="active_job_basics.html">Active Job Basics</a></dd>
70
+ <dd><a href="security.html">Securing Rails Applications</a></dd>
71
+ <dd><a href="debugging_rails_applications.html">Debugging Rails Applications</a></dd>
72
+ <dd><a href="configuring.html">Configuring Rails Applications</a></dd>
73
+ <dd><a href="command_line.html">Rails Command Line Tools and Rake Tasks</a></dd>
74
+ <dd><a href="asset_pipeline.html">Asset Pipeline</a></dd>
75
+ <dd><a href="working_with_javascript_in_rails.html">Working with JavaScript in Rails</a></dd>
76
+ <dt>Extending Rails</dt>
77
+ <dd><a href="rails_on_rack.html">Rails on Rack</a></dd>
78
+ <dd><a href="generators.html">Creating and Customizing Rails Generators</a></dd>
79
+ <dt>Contributing to Ruby on Rails</dt>
80
+ <dd><a href="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</a></dd>
81
+ <dd><a href="api_documentation_guidelines.html">API Documentation Guidelines</a></dd>
82
+ <dd><a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a></dd>
83
+ <dt>Maintenance Policy</dt>
84
+ <dd><a href="maintenance_policy.html">Maintenance Policy</a></dd>
85
+ <dt>Release Notes</dt>
86
+ <dd><a href="upgrading_ruby_on_rails.html">Upgrading Ruby on Rails</a></dd>
87
+ <dd><a href="4_1_release_notes.html">Ruby on Rails 4.1 Release Notes</a></dd>
88
+ <dd><a href="4_0_release_notes.html">Ruby on Rails 4.0 Release Notes</a></dd>
89
+ <dd><a href="3_2_release_notes.html">Ruby on Rails 3.2 Release Notes</a></dd>
90
+ <dd><a href="3_1_release_notes.html">Ruby on Rails 3.1 Release Notes</a></dd>
91
+ <dd><a href="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</a></dd>
92
+ <dd><a href="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</a></dd>
93
+ <dd><a href="2_2_release_notes.html">Ruby on Rails 2.2 Release Notes</a></dd>
94
+ </dl>
95
+ </div>
96
+ </li>
97
+ <li><a class="nav-item" href="contributing_to_ruby_on_rails.html">Contribute</a></li>
98
+ <li><a class="nav-item" href="credits.html">Credits</a></li>
99
+ <li class="guides-index guides-index-small">
100
+ <select class="guides-index-item nav-item">
101
+ <option value="index.html">Guides Index</option>
102
+ <optgroup label="Start Here">
103
+ <option value="getting_started.html">Getting Started with Rails</option>
104
+ </optgroup>
105
+ <optgroup label="Models">
106
+ <option value="active_record_basics.html">Active Record Basics</option>
107
+ <option value="active_record_migrations.html">Active Record Migrations</option>
108
+ <option value="active_record_validations.html">Active Record Validations</option>
109
+ <option value="active_record_callbacks.html">Active Record Callbacks</option>
110
+ <option value="association_basics.html">Active Record Associations</option>
111
+ <option value="active_record_querying.html">Active Record Query Interface</option>
112
+ </optgroup>
113
+ <optgroup label="Views">
114
+ <option value="layouts_and_rendering.html">Layouts and Rendering in Rails</option>
115
+ <option value="form_helpers.html">Action View Form Helpers</option>
116
+ </optgroup>
117
+ <optgroup label="Controllers">
118
+ <option value="action_controller_overview.html">Action Controller Overview</option>
119
+ <option value="routing.html">Rails Routing from the Outside In</option>
120
+ </optgroup>
121
+ <optgroup label="Digging Deeper">
122
+ <option value="active_support_core_extensions.html">Active Support Core Extensions</option>
123
+ <option value="i18n.html">Rails Internationalization API</option>
124
+ <option value="action_mailer_basics.html">Action Mailer Basics</option>
125
+ <option value="active_job_basics.html">Active Job Basics</option>
126
+ <option value="security.html">Securing Rails Applications</option>
127
+ <option value="debugging_rails_applications.html">Debugging Rails Applications</option>
128
+ <option value="configuring.html">Configuring Rails Applications</option>
129
+ <option value="command_line.html">Rails Command Line Tools and Rake Tasks</option>
130
+ <option value="asset_pipeline.html">Asset Pipeline</option>
131
+ <option value="working_with_javascript_in_rails.html">Working with JavaScript in Rails</option>
132
+ </optgroup>
133
+ <optgroup label="Extending Rails">
134
+ <option value="rails_on_rack.html">Rails on Rack</option>
135
+ <option value="generators.html">Creating and Customizing Rails Generators</option>
136
+ </optgroup>
137
+ <optgroup label="Contributing to Ruby on Rails">
138
+ <option value="contributing_to_ruby_on_rails.html">Contributing to Ruby on Rails</option>
139
+ <option value="api_documentation_guidelines.html">API Documentation Guidelines</option>
140
+ <option value="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</option>
141
+ </optgroup>
142
+ <optgroup label="Maintenance Policy">
143
+ <option value="maintenance_policy.html">Maintenance Policy</option>
144
+ </optgroup>
145
+ <optgroup label="Release Notes">
146
+ <option value="upgrading_ruby_on_rails.html">Upgrading Ruby on Rails</option>
147
+ <option value="4_1_release_notes.html">Ruby on Rails 4.1 Release Notes</option>
148
+ <option value="4_0_release_notes.html">Ruby on Rails 4.0 Release Notes</option>
149
+ <option value="3_2_release_notes.html">Ruby on Rails 3.2 Release Notes</option>
150
+ <option value="3_1_release_notes.html">Ruby on Rails 3.1 Release Notes</option>
151
+ <option value="3_0_release_notes.html">Ruby on Rails 3.0 Release Notes</option>
152
+ <option value="2_3_release_notes.html">Ruby on Rails 2.3 Release Notes</option>
153
+ <option value="2_2_release_notes.html">Ruby on Rails 2.2 Release Notes</option>
154
+ </optgroup>
155
+ </select>
156
+ </li>
157
+ </ul>
158
+ </div>
159
+ </div>
160
+ <hr class="hide" />
161
+
162
+ <div id="feature">
163
+ <div class="wrapper">
164
+ <h2>Ruby on Rails 4.1 Release Notes</h2><p>Highlights in Rails 4.1:</p>
165
+ <ul>
166
+ <li>Spring application preloader</li>
167
+ <li><code>config/secrets.yml</code></li>
168
+ <li>Action Pack variants</li>
169
+ <li>Action Mailer previews</li>
170
+ </ul>
171
+ <p>These release notes cover only the major changes. To know about various bug
172
+ fixes and changes, please refer to the change logs or check out the
173
+ <a href="https://github.com/rails/rails/commits/master">list of commits</a> in the main
174
+ Rails repository on GitHub.</p>
175
+
176
+ <div id="subCol">
177
+ <h3 class="chapter"><img src="images/chapters_icon.gif" alt="" />Chapters</h3>
178
+ <ol class="chapters">
179
+ <li><a href="#upgrading-to-rails-4.1">Upgrading to Rails 4.1</a></li>
180
+ <li>
181
+ <a href="#major-features">Major Features</a>
182
+
183
+ <ul>
184
+ <li><a href="#spring-application-preloader">Spring Application Preloader</a></li>
185
+ <li><a href="#config/secrets.yml"><code>config/secrets.yml</code></a></li>
186
+ <li><a href="#action-pack-variants">Action Pack Variants</a></li>
187
+ <li><a href="#action-mailer-previews">Action Mailer Previews</a></li>
188
+ <li><a href="#active-record-enums">Active Record enums</a></li>
189
+ <li><a href="#message-verifiers">Message Verifiers</a></li>
190
+ <li><a href="#module#concerning">Module#concerning</a></li>
191
+ <li><a href="#csrf-protection-from-remote-%3Cscript%3E-tags">CSRF protection from remote <code>&lt;script&gt;</code> tags</a></li>
192
+ </ul>
193
+ </li>
194
+ <li>
195
+ <a href="#railties">Railties</a>
196
+
197
+ <ul>
198
+ <li><a href="#railties-removals">Removals</a></li>
199
+ <li><a href="#railties-notable-changes">Notable changes</a></li>
200
+ </ul>
201
+ </li>
202
+ <li>
203
+ <a href="#action-pack">Action Pack</a>
204
+
205
+ <ul>
206
+ <li><a href="#action-pack-removals">Removals</a></li>
207
+ <li><a href="#action-pack-notable-changes">Notable changes</a></li>
208
+ </ul>
209
+ </li>
210
+ <li>
211
+ <a href="#action-mailer">Action Mailer</a>
212
+
213
+ <ul>
214
+ <li><a href="#action-mailer-notable-changes">Notable changes</a></li>
215
+ </ul>
216
+ </li>
217
+ <li>
218
+ <a href="#active-record">Active Record</a>
219
+
220
+ <ul>
221
+ <li><a href="#active-record-removals">Removals</a></li>
222
+ <li><a href="#active-record-deprecations">Deprecations</a></li>
223
+ <li><a href="#active-record-notable-changes">Notable changes</a></li>
224
+ </ul>
225
+ </li>
226
+ <li>
227
+ <a href="#active-model">Active Model</a>
228
+
229
+ <ul>
230
+ <li><a href="#active-model-deprecations">Deprecations</a></li>
231
+ <li><a href="#active-model-notable-changes">Notable changes</a></li>
232
+ </ul>
233
+ </li>
234
+ <li>
235
+ <a href="#active-support">Active Support</a>
236
+
237
+ <ul>
238
+ <li><a href="#active-support-removals">Removals</a></li>
239
+ <li><a href="#deprecations">Deprecations</a></li>
240
+ <li><a href="#active-support-notable-changes">Notable changes</a></li>
241
+ </ul>
242
+ </li>
243
+ <li><a href="#credits">Credits</a></li>
244
+ </ol>
245
+
246
+ </div>
247
+
248
+ </div>
249
+ </div>
250
+
251
+ <div id="container">
252
+ <div class="wrapper">
253
+ <div id="mainCol">
254
+ <h3 id="upgrading-to-rails-4.1">1 Upgrading to Rails 4.1</h3><p>If you're upgrading an existing application, it's a great idea to have good test
255
+ coverage before going in. You should also first upgrade to Rails 4.0 in case you
256
+ haven't and make sure your application still runs as expected before attempting
257
+ an update to Rails 4.1. A list of things to watch out for when upgrading is
258
+ available in the
259
+ <a href="upgrading_ruby_on_rails.html#upgrading-from-rails-4-0-to-rails-4-1">Upgrading Ruby on Rails</a>
260
+ guide.</p><h3 id="major-features">2 Major Features</h3><h4 id="spring-application-preloader">2.1 Spring Application Preloader</h4><p>Spring is a Rails application preloader. It speeds up development by keeping
261
+ your application running in the background so you don't need to boot it every
262
+ time you run a test, rake task or migration.</p><p>New Rails 4.1 applications will ship with "springified" binstubs. This means
263
+ that <code>bin/rails</code> and <code>bin/rake</code> will automatically take advantage of preloaded
264
+ spring environments.</p><p><strong>Running rake tasks:</strong></p><div class="code_container">
265
+ <pre class="brush: plain; gutter: false; toolbar: false">
266
+ bin/rake test:models
267
+
268
+ </pre>
269
+ </div>
270
+ <p><strong>Running a Rails command:</strong></p><div class="code_container">
271
+ <pre class="brush: plain; gutter: false; toolbar: false">
272
+ bin/rails console
273
+
274
+ </pre>
275
+ </div>
276
+ <p><strong>Spring introspection:</strong></p><div class="code_container">
277
+ <pre class="brush: plain; gutter: false; toolbar: false">
278
+ $ bin/spring status
279
+ Spring is running:
280
+
281
+ 1182 spring server | my_app | started 29 mins ago
282
+ 3656 spring app | my_app | started 23 secs ago | test mode
283
+ 3746 spring app | my_app | started 10 secs ago | development mode
284
+
285
+ </pre>
286
+ </div>
287
+ <p>Have a look at the
288
+ <a href="https://github.com/rails/spring/blob/master/README.md">Spring README</a> to
289
+ see all available features.</p><p>See the <a href="upgrading_ruby_on_rails.html#spring">Upgrading Ruby on Rails</a>
290
+ guide on how to migrate existing applications to use this feature.</p><h4 id="config/secrets.yml">2.2 <code>config/secrets.yml</code>
291
+ </h4><p>Rails 4.1 generates a new <code>secrets.yml</code> file in the <code>config</code> folder. By default,
292
+ this file contains the application's <code>secret_key_base</code>, but it could also be
293
+ used to store other secrets such as access keys for external APIs.</p><p>The secrets added to this file are accessible via <code>Rails.application.secrets</code>.
294
+ For example, with the following <code>config/secrets.yml</code>:</p><div class="code_container">
295
+ <pre class="brush: plain; gutter: false; toolbar: false">
296
+ development:
297
+ secret_key_base: 3b7cd727ee24e8444053437c36cc66c3
298
+ some_api_key: SOMEKEY
299
+
300
+ </pre>
301
+ </div>
302
+ <p><code>Rails.application.secrets.some_api_key</code> returns <code>SOMEKEY</code> in the development
303
+ environment.</p><p>See the <a href="upgrading_ruby_on_rails.html#config-secrets-yml">Upgrading Ruby on Rails</a>
304
+ guide on how to migrate existing applications to use this feature.</p><h4 id="action-pack-variants">2.3 Action Pack Variants</h4><p>We often want to render different HTML/JSON/XML templates for phones,
305
+ tablets, and desktop browsers. Variants make it easy.</p><p>The request variant is a specialization of the request format, like <code>:tablet</code>,
306
+ <code>:phone</code>, or <code>:desktop</code>.</p><p>You can set the variant in a <code>before_action</code>:</p><div class="code_container">
307
+ <pre class="brush: ruby; gutter: false; toolbar: false">
308
+ request.variant = :tablet if request.user_agent =~ /iPad/
309
+
310
+ </pre>
311
+ </div>
312
+ <p>Respond to variants in the action just like you respond to formats:</p><div class="code_container">
313
+ <pre class="brush: ruby; gutter: false; toolbar: false">
314
+ respond_to do |format|
315
+ format.html do |html|
316
+ html.tablet # renders app/views/projects/show.html+tablet.erb
317
+ html.phone { extra_setup; render ... }
318
+ end
319
+ end
320
+
321
+ </pre>
322
+ </div>
323
+ <p>Provide separate templates for each format and variant:</p><div class="code_container">
324
+ <pre class="brush: plain; gutter: false; toolbar: false">
325
+ app/views/projects/show.html.erb
326
+ app/views/projects/show.html+tablet.erb
327
+ app/views/projects/show.html+phone.erb
328
+
329
+ </pre>
330
+ </div>
331
+ <p>You can also simplify the variants definition using the inline syntax:</p><div class="code_container">
332
+ <pre class="brush: ruby; gutter: false; toolbar: false">
333
+ respond_to do |format|
334
+ format.js { render "trash" }
335
+ format.html.phone { redirect_to progress_path }
336
+ format.html.none { render "trash" }
337
+ end
338
+
339
+ </pre>
340
+ </div>
341
+ <h4 id="action-mailer-previews">2.4 Action Mailer Previews</h4><p>Action Mailer previews provide a way to visually see how emails look by visiting
342
+ a special URL that renders them.</p><p>You implement a preview class whose methods return the mail object you'd like
343
+ to check:</p><div class="code_container">
344
+ <pre class="brush: ruby; gutter: false; toolbar: false">
345
+ class NotifierPreview &lt; ActionMailer::Preview
346
+ def welcome
347
+ Notifier.welcome(User.first)
348
+ end
349
+ end
350
+
351
+ </pre>
352
+ </div>
353
+ <p>The preview is available in <a href="http://localhost:3000/rails/mailers/notifier/welcome">http://localhost:3000/rails/mailers/notifier/welcome</a>,
354
+ and a list of them in <a href="http://localhost:3000/rails/mailers">http://localhost:3000/rails/mailers</a>.</p><p>By default, these preview classes live in <code>test/mailers/previews</code>.
355
+ This can be configured using the <code>preview_path</code> option.</p><p>See its
356
+ <a href="http://api.rubyonrails.org/v4.1.0/classes/ActionMailer/Base.html#class-ActionMailer::Base-label-Previewing+emails">documentation</a>
357
+ for a detailed write up.</p><h4 id="active-record-enums">2.5 Active Record enums</h4><p>Declare an enum attribute where the values map to integers in the database, but
358
+ can be queried by name.</p><div class="code_container">
359
+ <pre class="brush: ruby; gutter: false; toolbar: false">
360
+ class Conversation &lt; ActiveRecord::Base
361
+ enum status: [ :active, :archived ]
362
+ end
363
+
364
+ conversation.archived!
365
+ conversation.active? # =&gt; false
366
+ conversation.status # =&gt; "archived"
367
+
368
+ Conversation.archived # =&gt; Relation for all archived Conversations
369
+
370
+ Conversation.statuses # =&gt; { "active" =&gt; 0, "archived" =&gt; 1 }
371
+
372
+ </pre>
373
+ </div>
374
+ <p>See its
375
+ <a href="http://api.rubyonrails.org/v4.1.0/classes/ActiveRecord/Enum.html">documentation</a>
376
+ for a detailed write up.</p><h4 id="message-verifiers">2.6 Message Verifiers</h4><p>Message verifiers can be used to generate and verify signed messages. This can
377
+ be useful to safely transport sensitive data like remember-me tokens and
378
+ friends.</p><p>The method <code>Rails.application.message_verifier</code> returns a new message verifier
379
+ that signs messages with a key derived from secret_key_base and the given
380
+ message verifier name:</p><div class="code_container">
381
+ <pre class="brush: ruby; gutter: false; toolbar: false">
382
+ signed_token = Rails.application.message_verifier(:remember_me).generate(token)
383
+ Rails.application.message_verifier(:remember_me).verify(signed_token) # =&gt; token
384
+
385
+ Rails.application.message_verifier(:remember_me).verify(tampered_token)
386
+ # raises ActiveSupport::MessageVerifier::InvalidSignature
387
+
388
+ </pre>
389
+ </div>
390
+ <h4 id="module#concerning">2.7 Module#concerning</h4><p>A natural, low-ceremony way to separate responsibilities within a class:</p><div class="code_container">
391
+ <pre class="brush: ruby; gutter: false; toolbar: false">
392
+ class Todo &lt; ActiveRecord::Base
393
+ concerning :EventTracking do
394
+ included do
395
+ has_many :events
396
+ end
397
+
398
+ def latest_event
399
+ ...
400
+ end
401
+
402
+ private
403
+ def some_internal_method
404
+ ...
405
+ end
406
+ end
407
+ end
408
+
409
+ </pre>
410
+ </div>
411
+ <p>This example is equivalent to defining a <code>EventTracking</code> module inline,
412
+ extending it with <code>ActiveSupport::Concern</code>, then mixing it in to the
413
+ <code>Todo</code> class.</p><p>See its
414
+ <a href="http://api.rubyonrails.org/v4.1.0/classes/Module/Concerning.html">documentation</a>
415
+ for a detailed write up and the intended use cases.</p><h4 id="csrf-protection-from-remote-&lt;script&gt;-tags">2.8 CSRF protection from remote <code>&lt;script&gt;</code> tags</h4><p>Cross-site request forgery (CSRF) protection now covers GET requests with
416
+ JavaScript responses, too. That prevents a third-party site from referencing
417
+ your JavaScript URL and attempting to run it to extract sensitive data.</p><p>This means any of your tests that hit <code>.js</code> URLs will now fail CSRF protection
418
+ unless they use <code>xhr</code>. Upgrade your tests to be explicit about expecting
419
+ XmlHttpRequests. Instead of <code>post :create, format: :js</code>, switch to the explicit
420
+ <code>xhr :post, :create, format: :js</code>.</p><h3 id="railties">3 Railties</h3><p>Please refer to the
421
+ <a href="https://github.com/rails/rails/blob/4-1-stable/railties/CHANGELOG.md">Changelog</a>
422
+ for detailed changes.</p><h4 id="railties-removals">3.1 Removals</h4>
423
+ <ul>
424
+ <li><p>Removed <code>update:application_controller</code> rake task.</p></li>
425
+ <li><p>Removed deprecated <code>Rails.application.railties.engines</code>.</p></li>
426
+ <li><p>Removed deprecated <code>threadsafe!</code> from Rails Config.</p></li>
427
+ <li><p>Removed deprecated <code>ActiveRecord::Generators::ActiveModel#update_attributes</code> in
428
+ favor of <code>ActiveRecord::Generators::ActiveModel#update</code>.</p></li>
429
+ <li><p>Removed deprecated <code>config.whiny_nils</code> option.</p></li>
430
+ <li><p>Removed deprecated rake tasks for running tests: <code>rake test:uncommitted</code> and
431
+ <code>rake test:recent</code>.</p></li>
432
+ </ul>
433
+ <h4 id="railties-notable-changes">3.2 Notable changes</h4>
434
+ <ul>
435
+ <li><p>The <a href="https://github.com/rails/spring">Spring application
436
+ preloader</a> is now installed
437
+ by default for new applications. It uses the development group of
438
+ the Gemfile, so will not be installed in
439
+ production. (<a href="https://github.com/rails/rails/pull/12958">Pull Request</a>)</p></li>
440
+ <li><p><code>BACKTRACE</code> environment variable to show unfiltered backtraces for test
441
+ failures. (<a href="https://github.com/rails/rails/commit/84eac5dab8b0fe9ee20b51250e52ad7bfea36553">Commit</a>)</p></li>
442
+ <li><p>Exposed <code>MiddlewareStack#unshift</code> to environment
443
+ configuration. (<a href="https://github.com/rails/rails/pull/12479">Pull Request</a>)</p></li>
444
+ <li><p>Added <code>Application#message_verifier</code> method to return a message
445
+ verifier. (<a href="https://github.com/rails/rails/pull/12995">Pull Request</a>)</p></li>
446
+ <li><p>The <code>test_help.rb</code> file which is required by the default generated test
447
+ helper will automatically keep your test database up-to-date with
448
+ <code>db/schema.rb</code> (or <code>db/structure.sql</code>). It raises an error if
449
+ reloading the schema does not resolve all pending migrations. Opt out
450
+ with <code>config.active_record.maintain_test_schema = false</code>. (<a href="https://github.com/rails/rails/pull/13528">Pull
451
+ Request</a>)</p></li>
452
+ <li><p>Introduce <code>Rails.gem_version</code> as a convenience method to return
453
+ <code>Gem::Version.new(Rails.version)</code>, suggesting a more reliable way to perform
454
+ version comparison. (<a href="https://github.com/rails/rails/pull/14103">Pull Request</a>)</p></li>
455
+ </ul>
456
+ <h3 id="action-pack">4 Action Pack</h3><p>Please refer to the
457
+ <a href="https://github.com/rails/rails/blob/4-1-stable/actionpack/CHANGELOG.md">Changelog</a>
458
+ for detailed changes.</p><h4 id="action-pack-removals">4.1 Removals</h4>
459
+ <ul>
460
+ <li><p>Removed deprecated Rails application fallback for integration testing, set
461
+ <code>ActionDispatch.test_app</code> instead.</p></li>
462
+ <li><p>Removed deprecated <code>page_cache_extension</code> config.</p></li>
463
+ <li><p>Removed deprecated <code>ActionController::RecordIdentifier</code>, use
464
+ <code>ActionView::RecordIdentifier</code> instead.</p></li>
465
+ <li><p>Removed deprecated constants from Action Controller:</p></li>
466
+ </ul>
467
+ <p> | Removed | Successor |
468
+ |:-----------------------------------|:--------------------------------|
469
+ | ActionController::AbstractRequest | ActionDispatch::Request |
470
+ | ActionController::Request | ActionDispatch::Request |
471
+ | ActionController::AbstractResponse | ActionDispatch::Response |
472
+ | ActionController::Response | ActionDispatch::Response |
473
+ | ActionController::Routing | ActionDispatch::Routing |
474
+ | ActionController::Integration | ActionDispatch::Integration |
475
+ | ActionController::IntegrationTest | ActionDispatch::IntegrationTest |</p><h4 id="action-pack-notable-changes">4.2 Notable changes</h4>
476
+ <ul>
477
+ <li><p><code>protect_from_forgery</code> also prevents cross-origin <code>&lt;script&gt;</code> tags.
478
+ Update your tests to use <code>xhr :get, :foo, format: :js</code> instead of
479
+ <code>get :foo, format: :js</code>.
480
+ (<a href="https://github.com/rails/rails/pull/13345">Pull Request</a>)</p></li>
481
+ <li><p><code>#url_for</code> takes a hash with options inside an
482
+ array. (<a href="https://github.com/rails/rails/pull/9599">Pull Request</a>)</p></li>
483
+ <li><p>Added <code>session#fetch</code> method fetch behaves similarly to
484
+ <a href="http://www.ruby-doc.org/core-1.9.3/Hash.html#method-i-fetch">Hash#fetch</a>,
485
+ with the exception that the returned value is always saved into the
486
+ session. (<a href="https://github.com/rails/rails/pull/12692">Pull Request</a>)</p></li>
487
+ <li><p>Separated Action View completely from Action
488
+ Pack. (<a href="https://github.com/rails/rails/pull/11032">Pull Request</a>)</p></li>
489
+ <li><p>Log which keys were affected by deep
490
+ munge. (<a href="https://github.com/rails/rails/pull/13813">Pull Request</a>)</p></li>
491
+ <li><p>New config option <code>config.action_dispatch.perform_deep_munge</code> to opt out of
492
+ params "deep munging" that was used to address security vulnerability
493
+ CVE-2013-0155. (<a href="https://github.com/rails/rails/pull/13188">Pull Request</a>)</p></li>
494
+ <li><p>New config option <code>config.action_dispatch.cookies_serializer</code> for specifying a
495
+ serializer for the signed and encrypted cookie jars. (Pull Requests
496
+ <a href="https://github.com/rails/rails/pull/13692">1</a>,
497
+ <a href="https://github.com/rails/rails/pull/13945">2</a> /
498
+ <a href="upgrading_ruby_on_rails.html#cookies-serializer">More Details</a>)</p></li>
499
+ <li><p>Added <code>render :plain</code>, <code>render :html</code> and <code>render
500
+ :body</code>. (<a href="https://github.com/rails/rails/pull/14062">Pull Request</a> /
501
+ <a href="upgrading_ruby_on_rails.html#rendering-content-from-string">More Details</a>)</p></li>
502
+ </ul>
503
+ <h3 id="action-mailer">5 Action Mailer</h3><p>Please refer to the
504
+ <a href="https://github.com/rails/rails/blob/4-1-stable/actionmailer/CHANGELOG.md">Changelog</a>
505
+ for detailed changes.</p><h4 id="action-mailer-notable-changes">5.1 Notable changes</h4>
506
+ <ul>
507
+ <li><p>Added mailer previews feature based on 37 Signals mail_view
508
+ gem. (<a href="https://github.com/rails/rails/commit/d6dec7fcb6b8fddf8c170182d4fe64ecfc7b2261">Commit</a>)</p></li>
509
+ <li><p>Instrument the generation of Action Mailer messages. The time it takes to
510
+ generate a message is written to the log. (<a href="https://github.com/rails/rails/pull/12556">Pull Request</a>)</p></li>
511
+ </ul>
512
+ <h3 id="active-record">6 Active Record</h3><p>Please refer to the
513
+ <a href="https://github.com/rails/rails/blob/4-1-stable/activerecord/CHANGELOG.md">Changelog</a>
514
+ for detailed changes.</p><h4 id="active-record-removals">6.1 Removals</h4>
515
+ <ul>
516
+ <li><p>Removed deprecated nil-passing to the following <code>SchemaCache</code> methods:
517
+ <code>primary_keys</code>, <code>tables</code>, <code>columns</code> and <code>columns_hash</code>.</p></li>
518
+ <li><p>Removed deprecated block filter from <code>ActiveRecord::Migrator#migrate</code>.</p></li>
519
+ <li><p>Removed deprecated String constructor from <code>ActiveRecord::Migrator</code>.</p></li>
520
+ <li><p>Removed deprecated <code>scope</code> use without passing a callable object.</p></li>
521
+ <li><p>Removed deprecated <code>transaction_joinable=</code> in favor of <code>begin_transaction</code>
522
+ with a <code>:joinable</code> option.</p></li>
523
+ <li><p>Removed deprecated <code>decrement_open_transactions</code>.</p></li>
524
+ <li><p>Removed deprecated <code>increment_open_transactions</code>.</p></li>
525
+ <li><p>Removed deprecated <code>PostgreSQLAdapter#outside_transaction?</code>
526
+ method. You can use <code>#transaction_open?</code> instead.</p></li>
527
+ <li><p>Removed deprecated <code>ActiveRecord::Fixtures.find_table_name</code> in favor of
528
+ <code>ActiveRecord::Fixtures.default_fixture_model_name</code>.</p></li>
529
+ <li><p>Removed deprecated <code>columns_for_remove</code> from <code>SchemaStatements</code>.</p></li>
530
+ <li><p>Removed deprecated <code>SchemaStatements#distinct</code>.</p></li>
531
+ <li><p>Moved deprecated <code>ActiveRecord::TestCase</code> into the Rails test
532
+ suite. The class is no longer public and is only used for internal
533
+ Rails tests.</p></li>
534
+ <li><p>Removed support for deprecated option <code>:restrict</code> for <code>:dependent</code>
535
+ in associations.</p></li>
536
+ <li><p>Removed support for deprecated <code>:delete_sql</code>, <code>:insert_sql</code>, <code>:finder_sql</code>
537
+ and <code>:counter_sql</code> options in associations.</p></li>
538
+ <li><p>Removed deprecated method <code>type_cast_code</code> from Column.</p></li>
539
+ <li><p>Removed deprecated <code>ActiveRecord::Base#connection</code> method.
540
+ Make sure to access it via the class.</p></li>
541
+ <li><p>Removed deprecation warning for <code>auto_explain_threshold_in_seconds</code>.</p></li>
542
+ <li><p>Removed deprecated <code>:distinct</code> option from <code>Relation#count</code>.</p></li>
543
+ <li><p>Removed deprecated methods <code>partial_updates</code>, <code>partial_updates?</code> and
544
+ <code>partial_updates=</code>.</p></li>
545
+ <li><p>Removed deprecated method <code>scoped</code>.</p></li>
546
+ <li><p>Removed deprecated method <code>default_scopes?</code>.</p></li>
547
+ <li><p>Remove implicit join references that were deprecated in 4.0.</p></li>
548
+ <li><p>Removed <code>activerecord-deprecated_finders</code> as a dependency.
549
+ Please see <a href="https://github.com/rails/activerecord-deprecated_finders#active-record-deprecated-finders">the gem README</a>
550
+ for more info.</p></li>
551
+ <li><p>Removed usage of <code>implicit_readonly</code>. Please use <code>readonly</code> method
552
+ explicitly to mark records as
553
+ <code>readonly</code>. (<a href="https://github.com/rails/rails/pull/10769">Pull Request</a>)</p></li>
554
+ </ul>
555
+ <h4 id="active-record-deprecations">6.2 Deprecations</h4>
556
+ <ul>
557
+ <li><p>Deprecated <code>quoted_locking_column</code> method, which isn't used anywhere.</p></li>
558
+ <li><p>Deprecated <code>ConnectionAdapters::SchemaStatements#distinct</code>,
559
+ as it is no longer used by internals. (<a href="https://github.com/rails/rails/pull/10556">Pull Request</a>)</p></li>
560
+ <li><p>Deprecated <code>rake db:test:*</code> tasks as the test database is now
561
+ automatically maintained. See railties release notes. (<a href="https://github.com/rails/rails/pull/13528">Pull
562
+ Request</a>)</p></li>
563
+ <li><p>Deprecate unused <code>ActiveRecord::Base.symbolized_base_class</code>
564
+ and <code>ActiveRecord::Base.symbolized_sti_name</code> without
565
+ replacement. <a href="https://github.com/rails/rails/commit/97e7ca48c139ea5cce2fa9b4be631946252a1ebd">Commit</a></p></li>
566
+ </ul>
567
+ <h4 id="active-record-notable-changes">6.3 Notable changes</h4>
568
+ <ul>
569
+ <li>Default scopes are no longer overridden by chained conditions.</li>
570
+ </ul>
571
+ <p> Before this change when you defined a <code>default_scope</code> in a model
572
+ it was overridden by chained conditions in the same field. Now it
573
+ is merged like any other scope. <a href="upgrading_ruby_on_rails.html#changes-on-default-scopes">More Details</a>.</p>
574
+ <ul>
575
+ <li><p>Added <code>ActiveRecord::Base.to_param</code> for convenient "pretty" URLs derived from
576
+ a model's attribute or
577
+ method. (<a href="https://github.com/rails/rails/pull/12891">Pull Request</a>)</p></li>
578
+ <li><p>Added <code>ActiveRecord::Base.no_touching</code>, which allows ignoring touch on
579
+ models. (<a href="https://github.com/rails/rails/pull/12772">Pull Request</a>)</p></li>
580
+ <li><p>Unify boolean type casting for <code>MysqlAdapter</code> and <code>Mysql2Adapter</code>.
581
+ <code>type_cast</code> will return <code>1</code> for <code>true</code> and <code>0</code> for <code>false</code>. (<a href="https://github.com/rails/rails/pull/12425">Pull Request</a>)</p></li>
582
+ <li><p><code>.unscope</code> now removes conditions specified in
583
+ <code>default_scope</code>. (<a href="https://github.com/rails/rails/commit/94924dc32baf78f13e289172534c2e71c9c8cade">Commit</a>)</p></li>
584
+ <li><p>Added <code>ActiveRecord::QueryMethods#rewhere</code> which will overwrite an existing,
585
+ named where condition. (<a href="https://github.com/rails/rails/commit/f950b2699f97749ef706c6939a84dfc85f0b05f2">Commit</a>)</p></li>
586
+ <li><p>Extended <code>ActiveRecord::Base#cache_key</code> to take an optional list of timestamp
587
+ attributes of which the highest will be used. (<a href="https://github.com/rails/rails/commit/e94e97ca796c0759d8fcb8f946a3bbc60252d329">Commit</a>)</p></li>
588
+ <li><p>Added <code>ActiveRecord::Base#enum</code> for declaring enum attributes where the values
589
+ map to integers in the database, but can be queried by
590
+ name. (<a href="https://github.com/rails/rails/commit/db41eb8a6ea88b854bf5cd11070ea4245e1639c5">Commit</a>)</p></li>
591
+ <li><p>Type cast json values on write, so that the value is consistent with reading
592
+ from the database. (<a href="https://github.com/rails/rails/pull/12643">Pull Request</a>)</p></li>
593
+ <li><p>Type cast hstore values on write, so that the value is consistent
594
+ with reading from the database. (<a href="https://github.com/rails/rails/commit/5ac2341fab689344991b2a4817bd2bc8b3edac9d">Commit</a>)</p></li>
595
+ <li><p>Make <code>next_migration_number</code> accessible for third party
596
+ generators. (<a href="https://github.com/rails/rails/pull/12407">Pull Request</a>)</p></li>
597
+ <li><p>Calling <code>update_attributes</code> will now throw an <code>ArgumentError</code> whenever it
598
+ gets a <code>nil</code> argument. More specifically, it will throw an error if the
599
+ argument that it gets passed does not respond to to
600
+ <code>stringify_keys</code>. (<a href="https://github.com/rails/rails/pull/9860">Pull Request</a>)</p></li>
601
+ <li><p><code>CollectionAssociation#first</code>/<code>#last</code> (e.g. <code>has_many</code>) use a <code>LIMIT</code>ed
602
+ query to fetch results rather than loading the entire
603
+ collection. (<a href="https://github.com/rails/rails/pull/12137">Pull Request</a>)</p></li>
604
+ <li><p><code>inspect</code> on Active Record model classes does not initiate a new
605
+ connection. This means that calling <code>inspect</code>, when the database is missing,
606
+ will no longer raise an exception. (<a href="https://github.com/rails/rails/pull/11014">Pull Request</a>)</p></li>
607
+ <li><p>Removed column restrictions for <code>count</code>, let the database raise if the SQL is
608
+ invalid. (<a href="https://github.com/rails/rails/pull/10710">Pull Request</a>)</p></li>
609
+ <li><p>Rails now automatically detects inverse associations. If you do not set the
610
+ <code>:inverse_of</code> option on the association, then Active Record will guess the
611
+ inverse association based on heuristics. (<a href="https://github.com/rails/rails/pull/10886">Pull Request</a>)</p></li>
612
+ <li><p>Handle aliased attributes in ActiveRecord::Relation. When using symbol keys,
613
+ ActiveRecord will now translate aliased attribute names to the actual column
614
+ name used in the database. (<a href="https://github.com/rails/rails/pull/7839">Pull Request</a>)</p></li>
615
+ <li><p>The ERB in fixture files is no longer evaluated in the context of the main
616
+ object. Helper methods used by multiple fixtures should be defined on modules
617
+ included in <code>ActiveRecord::FixtureSet.context_class</code>. (<a href="https://github.com/rails/rails/pull/13022">Pull Request</a>)</p></li>
618
+ <li><p>Don't create or drop the test database if RAILS_ENV is specified
619
+ explicitly. (<a href="https://github.com/rails/rails/pull/13629">Pull Request</a>)</p></li>
620
+ <li><p><code>Relation</code> no longer has mutator methods like <code>#map!</code> and <code>#delete_if</code>. Convert
621
+ to an <code>Array</code> by calling <code>#to_a</code> before using these methods. (<a href="https://github.com/rails/rails/pull/13314">Pull Request</a>)</p></li>
622
+ <li><p><code>find_in_batches</code>, <code>find_each</code>, <code>Result#each</code> and <code>Enumerable#index_by</code> now
623
+ return an <code>Enumerator</code> that can calculate its
624
+ size. (<a href="https://github.com/rails/rails/pull/13938">Pull Request</a>)</p></li>
625
+ <li><p><code>scope</code>, <code>enum</code> and Associations now raise on "dangerous" name
626
+ conflicts. (<a href="https://github.com/rails/rails/pull/13450">Pull Request</a>,
627
+ <a href="https://github.com/rails/rails/pull/13896">Pull Request</a>)</p></li>
628
+ <li><p><code>second</code> through <code>fifth</code> methods act like the <code>first</code>
629
+ finder. (<a href="https://github.com/rails/rails/pull/13757">Pull Request</a>)</p></li>
630
+ <li><p>Make <code>touch</code> fire the <code>after_commit</code> and <code>after_rollback</code>
631
+ callbacks. (<a href="https://github.com/rails/rails/pull/12031">Pull Request</a>)</p></li>
632
+ <li><p>Enable partial indexes for <code>sqlite &gt;= 3.8.0</code>.
633
+ (<a href="https://github.com/rails/rails/pull/13350">Pull Request</a>)</p></li>
634
+ <li><p>Make <code>change_column_null</code>
635
+ revertible. (<a href="https://github.com/rails/rails/commit/724509a9d5322ff502aefa90dd282ba33a281a96">Commit</a>)</p></li>
636
+ <li><p>Added a flag to disable schema dump after migration. This is set to <code>false</code>
637
+ by default in the production environment for new applications.
638
+ (<a href="https://github.com/rails/rails/pull/13948">Pull Request</a>)</p></li>
639
+ </ul>
640
+ <h3 id="active-model">7 Active Model</h3><p>Please refer to the
641
+ <a href="https://github.com/rails/rails/blob/4-1-stable/activemodel/CHANGELOG.md">Changelog</a>
642
+ for detailed changes.</p><h4 id="active-model-deprecations">7.1 Deprecations</h4>
643
+ <ul>
644
+ <li>Deprecate <code>Validator#setup</code>. This should be done manually now in the
645
+ validator's constructor. (<a href="https://github.com/rails/rails/commit/7d84c3a2f7ede0e8d04540e9c0640de7378e9b3a">Commit</a>)</li>
646
+ </ul>
647
+ <h4 id="active-model-notable-changes">7.2 Notable changes</h4>
648
+ <ul>
649
+ <li><p>Added new API methods <code>reset_changes</code> and <code>changes_applied</code> to
650
+ <code>ActiveModel::Dirty</code> that control changes state.</p></li>
651
+ <li><p>Ability to specify multiple contexts when defining a
652
+ validation. (<a href="https://github.com/rails/rails/pull/13754">Pull Request</a>)</p></li>
653
+ <li><p><code>attribute_changed?</code> now accepts a hash to check if the attribute was changed
654
+ <code>:from</code> and/or <code>:to</code> a given
655
+ value. (<a href="https://github.com/rails/rails/pull/13131">Pull Request</a>)</p></li>
656
+ </ul>
657
+ <h3 id="active-support">8 Active Support</h3><p>Please refer to the
658
+ <a href="https://github.com/rails/rails/blob/4-1-stable/activesupport/CHANGELOG.md">Changelog</a>
659
+ for detailed changes.</p><h4 id="active-support-removals">8.1 Removals</h4>
660
+ <ul>
661
+ <li><p>Removed <code>MultiJSON</code> dependency. As a result, <code>ActiveSupport::JSON.decode</code>
662
+ no longer accepts an options hash for <code>MultiJSON</code>. (<a href="https://github.com/rails/rails/pull/10576">Pull Request</a> / <a href="upgrading_ruby_on_rails.html#changes-in-json-handling">More Details</a>)</p></li>
663
+ <li><p>Removed support for the <code>encode_json</code> hook used for encoding custom objects into
664
+ JSON. This feature has been extracted into the <a href="https://github.com/rails/activesupport-json_encoder">activesupport-json_encoder</a>
665
+ gem.
666
+ (<a href="https://github.com/rails/rails/pull/12183">Related Pull Request</a> /
667
+ <a href="upgrading_ruby_on_rails.html#changes-in-json-handling">More Details</a>)</p></li>
668
+ <li><p>Removed deprecated <code>ActiveSupport::JSON::Variable</code> with no replacement.</p></li>
669
+ <li><p>Removed deprecated <code>String#encoding_aware?</code> core extensions (<code>core_ext/string/encoding</code>).</p></li>
670
+ <li><p>Removed deprecated <code>Module#local_constant_names</code> in favor of <code>Module#local_constants</code>.</p></li>
671
+ <li><p>Removed deprecated <code>DateTime.local_offset</code> in favor of <code>DateTime.civil_from_format</code>.</p></li>
672
+ <li><p>Removed deprecated <code>Logger</code> core extensions (<code>core_ext/logger.rb</code>).</p></li>
673
+ <li><p>Removed deprecated <code>Time#time_with_datetime_fallback</code>, <code>Time#utc_time</code> and
674
+ <code>Time#local_time</code> in favor of <code>Time#utc</code> and <code>Time#local</code>.</p></li>
675
+ <li><p>Removed deprecated <code>Hash#diff</code> with no replacement.</p></li>
676
+ <li><p>Removed deprecated <code>Date#to_time_in_current_zone</code> in favor of <code>Date#in_time_zone</code>.</p></li>
677
+ <li><p>Removed deprecated <code>Proc#bind</code> with no replacement.</p></li>
678
+ <li><p>Removed deprecated <code>Array#uniq_by</code> and <code>Array#uniq_by!</code>, use native
679
+ <code>Array#uniq</code> and <code>Array#uniq!</code> instead.</p></li>
680
+ <li><p>Removed deprecated <code>ActiveSupport::BasicObject</code>, use
681
+ <code>ActiveSupport::ProxyObject</code> instead.</p></li>
682
+ <li><p>Removed deprecated <code>BufferedLogger</code>, use <code>ActiveSupport::Logger</code> instead.</p></li>
683
+ <li><p>Removed deprecated <code>assert_present</code> and <code>assert_blank</code> methods, use <code>assert
684
+ object.blank?</code> and <code>assert object.present?</code> instead.</p></li>
685
+ <li><p>Remove deprecated <code>#filter</code> method for filter objects, use the corresponding
686
+ method instead (e.g. <code>#before</code> for a before filter).</p></li>
687
+ <li><p>Removed 'cow' =&gt; 'kine' irregular inflection from default
688
+ inflections. (<a href="https://github.com/rails/rails/commit/c300dca9963bda78b8f358dbcb59cabcdc5e1dc9">Commit</a>)</p></li>
689
+ </ul>
690
+ <h4 id="deprecations">8.2 Deprecations</h4>
691
+ <ul>
692
+ <li><p>Deprecated <code>Numeric#{ago,until,since,from_now}</code>, the user is expected to
693
+ explicitly convert the value into an AS::Duration, i.e. <code>5.ago</code> =&gt; <code>5.seconds.ago</code>
694
+ (<a href="https://github.com/rails/rails/pull/12389">Pull Request</a>)</p></li>
695
+ <li><p>Deprecated the require path <code>active_support/core_ext/object/to_json</code>. Require
696
+ <code>active_support/core_ext/object/json</code> instead. (<a href="https://github.com/rails/rails/pull/12203">Pull Request</a>)</p></li>
697
+ <li><p>Deprecated <code>ActiveSupport::JSON::Encoding::CircularReferenceError</code>. This feature
698
+ has been extracted into the <a href="https://github.com/rails/activesupport-json_encoder">activesupport-json_encoder</a>
699
+ gem.
700
+ (<a href="https://github.com/rails/rails/pull/12785">Pull Request</a> /
701
+ <a href="upgrading_ruby_on_rails.html#changes-in-json-handling">More Details</a>)</p></li>
702
+ <li><p>Deprecated <code>ActiveSupport.encode_big_decimal_as_string</code> option. This feature has
703
+ been extracted into the <a href="https://github.com/rails/activesupport-json_encoder">activesupport-json_encoder</a>
704
+ gem.
705
+ (<a href="https://github.com/rails/rails/pull/13060">Pull Request</a> /
706
+ <a href="upgrading_ruby_on_rails.html#changes-in-json-handling">More Details</a>)</p></li>
707
+ <li><p>Deprecate custom <code>BigDecimal</code>
708
+ serialization. (<a href="https://github.com/rails/rails/pull/13911">Pull Request</a>)</p></li>
709
+ </ul>
710
+ <h4 id="active-support-notable-changes">8.3 Notable changes</h4>
711
+ <ul>
712
+ <li><p><code>ActiveSupport</code>'s JSON encoder has been rewritten to take advantage of the
713
+ JSON gem rather than doing custom encoding in pure-Ruby.
714
+ (<a href="https://github.com/rails/rails/pull/12183">Pull Request</a> /
715
+ <a href="upgrading_ruby_on_rails.html#changes-in-json-handling">More Details</a>)</p></li>
716
+ <li><p>Improved compatibility with the JSON gem.
717
+ (<a href="https://github.com/rails/rails/pull/12862">Pull Request</a> /
718
+ <a href="upgrading_ruby_on_rails.html#changes-in-json-handling">More Details</a>)</p></li>
719
+ <li><p>Added <code>ActiveSupport::Testing::TimeHelpers#travel</code> and <code>#travel_to</code>. These
720
+ methods change current time to the given time or duration by stubbing
721
+ <code>Time.now</code> and <code>Date.today</code>.</p></li>
722
+ <li><p>Added <code>ActiveSupport::Testing::TimeHelpers#travel_back</code>. This method returns
723
+ the current time to the original state, by removing the stubs added by <code>travel</code>
724
+ and <code>travel_to</code>. (<a href="https://github.com/rails/rails/pull/13884">Pull Request</a>)</p></li>
725
+ <li><p>Added <code>Numeric#in_milliseconds</code>, like <code>1.hour.in_milliseconds</code>, so we can feed
726
+ them to JavaScript functions like
727
+ <code>getTime()</code>. (<a href="https://github.com/rails/rails/commit/423249504a2b468d7a273cbe6accf4f21cb0e643">Commit</a>)</p></li>
728
+ <li><p>Added <code>Date#middle_of_day</code>, <code>DateTime#middle_of_day</code> and <code>Time#middle_of_day</code>
729
+ methods. Also added <code>midday</code>, <code>noon</code>, <code>at_midday</code>, <code>at_noon</code> and
730
+ <code>at_middle_of_day</code> as
731
+ aliases. (<a href="https://github.com/rails/rails/pull/10879">Pull Request</a>)</p></li>
732
+ <li><p>Added <code>Date#all_week/month/quarter/year</code> for generating date
733
+ ranges. (<a href="https://github.com/rails/rails/pull/9685">Pull Request</a>)</p></li>
734
+ <li><p>Added <code>Time.zone.yesterday</code> and
735
+ <code>Time.zone.tomorrow</code>. (<a href="https://github.com/rails/rails/pull/12822">Pull Request</a>)</p></li>
736
+ <li><p>Added <code>String#remove(pattern)</code> as a short-hand for the common pattern of
737
+ <code>String#gsub(pattern,'')</code>. (<a href="https://github.com/rails/rails/commit/5da23a3f921f0a4a3139495d2779ab0d3bd4cb5f">Commit</a>)</p></li>
738
+ <li><p>Added <code>Hash#compact</code> and <code>Hash#compact!</code> for removing items with nil value
739
+ from hash. (<a href="https://github.com/rails/rails/pull/13632">Pull Request</a>)</p></li>
740
+ <li><p><code>blank?</code> and <code>present?</code> commit to return
741
+ singletons. (<a href="https://github.com/rails/rails/commit/126dc47665c65cd129967cbd8a5926dddd0aa514">Commit</a>)</p></li>
742
+ <li><p>Default the new <code>I18n.enforce_available_locales</code> config to <code>true</code>, meaning
743
+ <code>I18n</code> will make sure that all locales passed to it must be declared in the
744
+ <code>available_locales</code>
745
+ list. (<a href="https://github.com/rails/rails/pull/13341">Pull Request</a>)</p></li>
746
+ <li><p>Introduce <code>Module#concerning</code>: a natural, low-ceremony way to separate
747
+ responsibilities within a
748
+ class. (<a href="https://github.com/rails/rails/commit/1eee0ca6de975b42524105a59e0521d18b38ab81">Commit</a>)</p></li>
749
+ <li><p>Added <code>Object#presence_in</code> to simplify value whitelisting.
750
+ (<a href="https://github.com/rails/rails/commit/4edca106daacc5a159289eae255207d160f22396">Commit</a>)</p></li>
751
+ </ul>
752
+ <h3 id="credits">9 Credits</h3><p>See the
753
+ <a href="http://contributors.rubyonrails.org/">full list of contributors to Rails</a> for
754
+ the many people who spent many hours making Rails, the stable and robust
755
+ framework it is. Kudos to all of them.</p>
756
+
757
+ <h3>Feedback</h3>
758
+ <p>
759
+ You're encouraged to help improve the quality of this guide.
760
+ </p>
761
+ <p>
762
+ Please contribute if you see any typos or factual errors.
763
+ To get started, you can read our <a href="http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#contributing-to-the-rails-documentation">documentation contributions</a> section.
764
+ </p>
765
+ <p>
766
+ You may also find incomplete content, or stuff that is not up to date.
767
+ Please do add any missing documentation for master. Make sure to check
768
+ <a href="http://edgeguides.rubyonrails.org">Edge Guides</a> first to verify
769
+ if the issues are already fixed or not on the master branch.
770
+ Check the <a href="ruby_on_rails_guides_guidelines.html">Ruby on Rails Guides Guidelines</a>
771
+ for style and conventions.
772
+ </p>
773
+ <p>
774
+ If for whatever reason you spot something to fix but cannot patch it yourself, please
775
+ <a href="https://github.com/rails/rails/issues">open an issue</a>.
776
+ </p>
777
+ <p>And last but not least, any kind of discussion regarding Ruby on Rails
778
+ documentation is very welcome in the <a href="http://groups.google.com/group/rubyonrails-docs">rubyonrails-docs mailing list</a>.
779
+ </p>
780
+ </div>
781
+ </div>
782
+ </div>
783
+
784
+ <hr class="hide" />
785
+ <div id="footer">
786
+ <div class="wrapper">
787
+ <p>This work is licensed under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International</a> License</p>
788
+ <p>"Rails", "Ruby on Rails", and the Rails logo are trademarks of David Heinemeier Hansson. All rights reserved.</p>
789
+
790
+ </div>
791
+ </div>
792
+
793
+ <script type="text/javascript" src="javascripts/jquery.min.js"></script>
794
+ <script type="text/javascript" src="javascripts/responsive-tables.js"></script>
795
+ <script type="text/javascript" src="javascripts/guides.js"></script>
796
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shCore.js"></script>
797
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushRuby.js"></script>
798
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushXml.js"></script>
799
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushSql.js"></script>
800
+ <script type="text/javascript" src="javascripts/syntaxhighlighter/shBrushPlain.js"></script>
801
+ <script type="text/javascript">
802
+ SyntaxHighlighter.all();
803
+ $(guidesIndex.bind);
804
+ </script>
805
+ </body>
806
+ </html>