rails 4.1.14.2 → 5.2.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (286) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +33 -19
  3. metadata +65 -313
  4. data/guides/CHANGELOG.md +0 -106
  5. data/guides/Rakefile +0 -77
  6. data/guides/assets/images/akshaysurve.jpg +0 -0
  7. data/guides/assets/images/belongs_to.png +0 -0
  8. data/guides/assets/images/book_icon.gif +0 -0
  9. data/guides/assets/images/bullet.gif +0 -0
  10. data/guides/assets/images/chapters_icon.gif +0 -0
  11. data/guides/assets/images/check_bullet.gif +0 -0
  12. data/guides/assets/images/credits_pic_blank.gif +0 -0
  13. data/guides/assets/images/csrf.png +0 -0
  14. data/guides/assets/images/edge_badge.png +0 -0
  15. data/guides/assets/images/favicon.ico +0 -0
  16. data/guides/assets/images/feature_tile.gif +0 -0
  17. data/guides/assets/images/footer_tile.gif +0 -0
  18. data/guides/assets/images/fxn.png +0 -0
  19. data/guides/assets/images/getting_started/article_with_comments.png +0 -0
  20. data/guides/assets/images/getting_started/challenge.png +0 -0
  21. data/guides/assets/images/getting_started/confirm_dialog.png +0 -0
  22. data/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
  23. data/guides/assets/images/getting_started/form_with_errors.png +0 -0
  24. data/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
  25. data/guides/assets/images/getting_started/new_article.png +0 -0
  26. data/guides/assets/images/getting_started/rails_welcome.png +0 -0
  27. data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
  28. data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
  29. data/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
  30. data/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
  31. data/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
  32. data/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
  33. data/guides/assets/images/grey_bullet.gif +0 -0
  34. data/guides/assets/images/habtm.png +0 -0
  35. data/guides/assets/images/has_many.png +0 -0
  36. data/guides/assets/images/has_many_through.png +0 -0
  37. data/guides/assets/images/has_one.png +0 -0
  38. data/guides/assets/images/has_one_through.png +0 -0
  39. data/guides/assets/images/header_backdrop.png +0 -0
  40. data/guides/assets/images/header_tile.gif +0 -0
  41. data/guides/assets/images/i18n/demo_html_safe.png +0 -0
  42. data/guides/assets/images/i18n/demo_localized_pirate.png +0 -0
  43. data/guides/assets/images/i18n/demo_translated_en.png +0 -0
  44. data/guides/assets/images/i18n/demo_translated_pirate.png +0 -0
  45. data/guides/assets/images/i18n/demo_translation_missing.png +0 -0
  46. data/guides/assets/images/i18n/demo_untranslated.png +0 -0
  47. data/guides/assets/images/icons/README +0 -5
  48. data/guides/assets/images/icons/callouts/1.png +0 -0
  49. data/guides/assets/images/icons/callouts/10.png +0 -0
  50. data/guides/assets/images/icons/callouts/11.png +0 -0
  51. data/guides/assets/images/icons/callouts/12.png +0 -0
  52. data/guides/assets/images/icons/callouts/13.png +0 -0
  53. data/guides/assets/images/icons/callouts/14.png +0 -0
  54. data/guides/assets/images/icons/callouts/15.png +0 -0
  55. data/guides/assets/images/icons/callouts/2.png +0 -0
  56. data/guides/assets/images/icons/callouts/3.png +0 -0
  57. data/guides/assets/images/icons/callouts/4.png +0 -0
  58. data/guides/assets/images/icons/callouts/5.png +0 -0
  59. data/guides/assets/images/icons/callouts/6.png +0 -0
  60. data/guides/assets/images/icons/callouts/7.png +0 -0
  61. data/guides/assets/images/icons/callouts/8.png +0 -0
  62. data/guides/assets/images/icons/callouts/9.png +0 -0
  63. data/guides/assets/images/icons/caution.png +0 -0
  64. data/guides/assets/images/icons/example.png +0 -0
  65. data/guides/assets/images/icons/home.png +0 -0
  66. data/guides/assets/images/icons/important.png +0 -0
  67. data/guides/assets/images/icons/next.png +0 -0
  68. data/guides/assets/images/icons/note.png +0 -0
  69. data/guides/assets/images/icons/prev.png +0 -0
  70. data/guides/assets/images/icons/tip.png +0 -0
  71. data/guides/assets/images/icons/up.png +0 -0
  72. data/guides/assets/images/icons/warning.png +0 -0
  73. data/guides/assets/images/nav_arrow.gif +0 -0
  74. data/guides/assets/images/oscardelben.jpg +0 -0
  75. data/guides/assets/images/polymorphic.png +0 -0
  76. data/guides/assets/images/radar.png +0 -0
  77. data/guides/assets/images/rails4_features.png +0 -0
  78. data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
  79. data/guides/assets/images/rails_guides_logo.gif +0 -0
  80. data/guides/assets/images/rails_logo_remix.gif +0 -0
  81. data/guides/assets/images/session_fixation.png +0 -0
  82. data/guides/assets/images/tab_grey.gif +0 -0
  83. data/guides/assets/images/tab_info.gif +0 -0
  84. data/guides/assets/images/tab_note.gif +0 -0
  85. data/guides/assets/images/tab_red.gif +0 -0
  86. data/guides/assets/images/tab_yellow.gif +0 -0
  87. data/guides/assets/images/tab_yellow.png +0 -0
  88. data/guides/assets/images/vijaydev.jpg +0 -0
  89. data/guides/assets/javascripts/guides.js +0 -53
  90. data/guides/assets/javascripts/jquery.min.js +0 -4
  91. data/guides/assets/javascripts/responsive-tables.js +0 -43
  92. data/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +0 -59
  93. data/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +0 -75
  94. data/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +0 -59
  95. data/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +0 -65
  96. data/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +0 -100
  97. data/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +0 -97
  98. data/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +0 -91
  99. data/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +0 -55
  100. data/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +0 -41
  101. data/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +0 -52
  102. data/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +0 -67
  103. data/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +0 -52
  104. data/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +0 -57
  105. data/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +0 -58
  106. data/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +0 -72
  107. data/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +0 -88
  108. data/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +0 -33
  109. data/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +0 -74
  110. data/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +0 -64
  111. data/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +0 -55
  112. data/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +0 -94
  113. data/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +0 -51
  114. data/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +0 -66
  115. data/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +0 -56
  116. data/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +0 -69
  117. data/guides/assets/javascripts/syntaxhighlighter/shCore.js +0 -17
  118. data/guides/assets/stylesheets/fixes.css +0 -16
  119. data/guides/assets/stylesheets/kindle.css +0 -11
  120. data/guides/assets/stylesheets/main.css +0 -710
  121. data/guides/assets/stylesheets/print.css +0 -52
  122. data/guides/assets/stylesheets/reset.css +0 -43
  123. data/guides/assets/stylesheets/responsive-tables.css +0 -50
  124. data/guides/assets/stylesheets/style.css +0 -13
  125. data/guides/assets/stylesheets/syntaxhighlighter/shCore.css +0 -226
  126. data/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +0 -328
  127. data/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +0 -331
  128. data/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +0 -339
  129. data/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +0 -324
  130. data/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +0 -328
  131. data/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +0 -324
  132. data/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +0 -324
  133. data/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +0 -324
  134. data/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +0 -117
  135. data/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +0 -120
  136. data/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +0 -128
  137. data/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +0 -113
  138. data/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +0 -117
  139. data/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +0 -113
  140. data/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +0 -113
  141. data/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +0 -113
  142. data/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +0 -116
  143. data/guides/bug_report_templates/action_controller_gem.rb +0 -47
  144. data/guides/bug_report_templates/action_controller_master.rb +0 -53
  145. data/guides/bug_report_templates/active_record_gem.rb +0 -40
  146. data/guides/bug_report_templates/active_record_master.rb +0 -49
  147. data/guides/bug_report_templates/generic_gem.rb +0 -15
  148. data/guides/bug_report_templates/generic_master.rb +0 -26
  149. data/guides/code/getting_started/Gemfile +0 -40
  150. data/guides/code/getting_started/Gemfile.lock +0 -125
  151. data/guides/code/getting_started/README.rdoc +0 -28
  152. data/guides/code/getting_started/Rakefile +0 -6
  153. data/guides/code/getting_started/app/assets/javascripts/application.js +0 -15
  154. data/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +0 -3
  155. data/guides/code/getting_started/app/assets/javascripts/posts.js.coffee +0 -3
  156. data/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee +0 -3
  157. data/guides/code/getting_started/app/assets/stylesheets/application.css +0 -13
  158. data/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +0 -3
  159. data/guides/code/getting_started/app/assets/stylesheets/posts.css.scss +0 -3
  160. data/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss +0 -3
  161. data/guides/code/getting_started/app/controllers/application_controller.rb +0 -5
  162. data/guides/code/getting_started/app/controllers/comments_controller.rb +0 -23
  163. data/guides/code/getting_started/app/controllers/posts_controller.rb +0 -53
  164. data/guides/code/getting_started/app/controllers/welcome_controller.rb +0 -4
  165. data/guides/code/getting_started/app/helpers/application_helper.rb +0 -2
  166. data/guides/code/getting_started/app/helpers/comments_helper.rb +0 -2
  167. data/guides/code/getting_started/app/helpers/posts_helper.rb +0 -2
  168. data/guides/code/getting_started/app/helpers/welcome_helper.rb +0 -2
  169. data/guides/code/getting_started/app/models/comment.rb +0 -3
  170. data/guides/code/getting_started/app/models/post.rb +0 -7
  171. data/guides/code/getting_started/app/views/comments/_comment.html.erb +0 -15
  172. data/guides/code/getting_started/app/views/comments/_form.html.erb +0 -13
  173. data/guides/code/getting_started/app/views/layouts/application.html.erb +0 -14
  174. data/guides/code/getting_started/app/views/posts/_form.html.erb +0 -27
  175. data/guides/code/getting_started/app/views/posts/edit.html.erb +0 -5
  176. data/guides/code/getting_started/app/views/posts/index.html.erb +0 -21
  177. data/guides/code/getting_started/app/views/posts/new.html.erb +0 -5
  178. data/guides/code/getting_started/app/views/posts/show.html.erb +0 -18
  179. data/guides/code/getting_started/app/views/welcome/index.html.erb +0 -4
  180. data/guides/code/getting_started/bin/bundle +0 -4
  181. data/guides/code/getting_started/bin/rails +0 -4
  182. data/guides/code/getting_started/bin/rake +0 -4
  183. data/guides/code/getting_started/config.ru +0 -4
  184. data/guides/code/getting_started/config/application.rb +0 -18
  185. data/guides/code/getting_started/config/boot.rb +0 -4
  186. data/guides/code/getting_started/config/database.yml +0 -25
  187. data/guides/code/getting_started/config/environment.rb +0 -5
  188. data/guides/code/getting_started/config/environments/development.rb +0 -30
  189. data/guides/code/getting_started/config/environments/production.rb +0 -80
  190. data/guides/code/getting_started/config/environments/test.rb +0 -36
  191. data/guides/code/getting_started/config/initializers/backtrace_silencers.rb +0 -7
  192. data/guides/code/getting_started/config/initializers/filter_parameter_logging.rb +0 -4
  193. data/guides/code/getting_started/config/initializers/inflections.rb +0 -16
  194. data/guides/code/getting_started/config/initializers/locale.rb +0 -9
  195. data/guides/code/getting_started/config/initializers/mime_types.rb +0 -5
  196. data/guides/code/getting_started/config/initializers/secret_token.rb +0 -12
  197. data/guides/code/getting_started/config/initializers/session_store.rb +0 -3
  198. data/guides/code/getting_started/config/initializers/wrap_parameters.rb +0 -14
  199. data/guides/code/getting_started/config/locales/en.yml +0 -23
  200. data/guides/code/getting_started/config/routes.rb +0 -7
  201. data/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb +0 -10
  202. data/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb +0 -11
  203. data/guides/code/getting_started/db/schema.rb +0 -33
  204. data/guides/code/getting_started/db/seeds.rb +0 -7
  205. data/guides/code/getting_started/public/404.html +0 -60
  206. data/guides/code/getting_started/public/422.html +0 -60
  207. data/guides/code/getting_started/public/500.html +0 -59
  208. data/guides/code/getting_started/public/favicon.ico +0 -0
  209. data/guides/code/getting_started/public/robots.txt +0 -5
  210. data/guides/code/getting_started/test/controllers/comments_controller_test.rb +0 -7
  211. data/guides/code/getting_started/test/controllers/posts_controller_test.rb +0 -7
  212. data/guides/code/getting_started/test/controllers/welcome_controller_test.rb +0 -9
  213. data/guides/code/getting_started/test/fixtures/comments.yml +0 -11
  214. data/guides/code/getting_started/test/fixtures/posts.yml +0 -9
  215. data/guides/code/getting_started/test/helpers/comments_helper_test.rb +0 -4
  216. data/guides/code/getting_started/test/helpers/posts_helper_test.rb +0 -4
  217. data/guides/code/getting_started/test/helpers/welcome_helper_test.rb +0 -4
  218. data/guides/code/getting_started/test/models/comment_test.rb +0 -7
  219. data/guides/code/getting_started/test/models/post_test.rb +0 -7
  220. data/guides/code/getting_started/test/test_helper.rb +0 -12
  221. data/guides/rails_guides.rb +0 -63
  222. data/guides/rails_guides/generator.rb +0 -248
  223. data/guides/rails_guides/helpers.rb +0 -53
  224. data/guides/rails_guides/indexer.rb +0 -68
  225. data/guides/rails_guides/kindle.rb +0 -119
  226. data/guides/rails_guides/levenshtein.rb +0 -31
  227. data/guides/rails_guides/markdown.rb +0 -163
  228. data/guides/rails_guides/markdown/renderer.rb +0 -82
  229. data/guides/source/2_2_release_notes.md +0 -435
  230. data/guides/source/2_3_release_notes.md +0 -621
  231. data/guides/source/3_0_release_notes.md +0 -611
  232. data/guides/source/3_1_release_notes.md +0 -556
  233. data/guides/source/3_2_release_notes.md +0 -565
  234. data/guides/source/4_0_release_notes.md +0 -276
  235. data/guides/source/4_1_release_notes.md +0 -731
  236. data/guides/source/_license.html.erb +0 -2
  237. data/guides/source/_welcome.html.erb +0 -25
  238. data/guides/source/action_controller_overview.md +0 -1175
  239. data/guides/source/action_mailer_basics.md +0 -689
  240. data/guides/source/action_view_overview.md +0 -1602
  241. data/guides/source/active_model_basics.md +0 -200
  242. data/guides/source/active_record_basics.md +0 -373
  243. data/guides/source/active_record_callbacks.md +0 -410
  244. data/guides/source/active_record_querying.md +0 -1785
  245. data/guides/source/active_record_validations.md +0 -1169
  246. data/guides/source/active_support_core_extensions.md +0 -3817
  247. data/guides/source/active_support_instrumentation.md +0 -496
  248. data/guides/source/api_documentation_guidelines.md +0 -315
  249. data/guides/source/asset_pipeline.md +0 -1165
  250. data/guides/source/association_basics.md +0 -2229
  251. data/guides/source/caching_with_rails.md +0 -354
  252. data/guides/source/command_line.md +0 -603
  253. data/guides/source/configuring.md +0 -942
  254. data/guides/source/contributing_to_ruby_on_rails.md +0 -544
  255. data/guides/source/credits.html.erb +0 -80
  256. data/guides/source/debugging_rails_applications.md +0 -707
  257. data/guides/source/development_dependencies_install.md +0 -278
  258. data/guides/source/documents.yaml +0 -193
  259. data/guides/source/engines.md +0 -1412
  260. data/guides/source/form_helpers.md +0 -1001
  261. data/guides/source/generators.md +0 -663
  262. data/guides/source/getting_started.md +0 -1946
  263. data/guides/source/i18n.md +0 -1043
  264. data/guides/source/index.html.erb +0 -27
  265. data/guides/source/initialization.md +0 -657
  266. data/guides/source/kindle/copyright.html.erb +0 -1
  267. data/guides/source/kindle/layout.html.erb +0 -27
  268. data/guides/source/kindle/rails_guides.opf.erb +0 -52
  269. data/guides/source/kindle/toc.html.erb +0 -24
  270. data/guides/source/kindle/toc.ncx.erb +0 -64
  271. data/guides/source/kindle/welcome.html.erb +0 -5
  272. data/guides/source/layout.html.erb +0 -146
  273. data/guides/source/layouts_and_rendering.md +0 -1226
  274. data/guides/source/maintenance_policy.md +0 -75
  275. data/guides/source/migrations.md +0 -1143
  276. data/guides/source/nested_model_forms.md +0 -225
  277. data/guides/source/plugins.md +0 -444
  278. data/guides/source/rails_application_templates.md +0 -248
  279. data/guides/source/rails_on_rack.md +0 -332
  280. data/guides/source/routing.md +0 -1115
  281. data/guides/source/ruby_on_rails_guides_guidelines.md +0 -128
  282. data/guides/source/security.md +0 -1018
  283. data/guides/source/testing.md +0 -1052
  284. data/guides/source/upgrading_ruby_on_rails.md +0 -928
  285. data/guides/source/working_with_javascript_in_rails.md +0 -405
  286. data/guides/w3c_validator.rb +0 -95
@@ -1,565 +0,0 @@
1
- Ruby on Rails 3.2 Release Notes
2
- ===============================
3
-
4
- Highlights in Rails 3.2:
5
-
6
- * Faster Development Mode
7
- * New Routing Engine
8
- * Automatic Query Explains
9
- * Tagged Logging
10
-
11
- These release notes cover the major changes, but do not include each bug-fix and changes. If you want to see everything, check out the [list of commits](https://github.com/rails/rails/commits/3-2-stable) in the main Rails repository on GitHub.
12
-
13
- --------------------------------------------------------------------------------
14
-
15
- Upgrading to Rails 3.2
16
- ----------------------
17
-
18
- If you're upgrading an existing application, it's a great idea to have good test coverage before going in. You should also first upgrade to Rails 3.1 in case you haven't and make sure your application still runs as expected before attempting an update to Rails 3.2. Then take heed of the following changes:
19
-
20
- ### Rails 3.2 requires at least Ruby 1.8.7
21
-
22
- Rails 3.2 requires Ruby 1.8.7 or higher. Support for all of the previous Ruby versions has been dropped officially and you should upgrade as early as possible. Rails 3.2 is also compatible with Ruby 1.9.2.
23
-
24
- TIP: Note that Ruby 1.8.7 p248 and p249 have marshalling bugs that crash Rails. Ruby Enterprise Edition has these fixed since the release of 1.8.7-2010.02. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults, so if you want to use 1.9.x, jump on to 1.9.2 or 1.9.3 for smooth sailing.
25
-
26
- ### What to update in your apps
27
-
28
- * Update your Gemfile to depend on
29
- * `rails = 3.2.0`
30
- * `sass-rails ~> 3.2.3`
31
- * `coffee-rails ~> 3.2.1`
32
- * `uglifier >= 1.0.3`
33
-
34
- * Rails 3.2 deprecates `vendor/plugins` and Rails 4.0 will remove them completely. You can start replacing these plugins by extracting them as gems and adding them in your Gemfile. If you choose not to make them gems, you can move them into, say, `lib/my_plugin/*` and add an appropriate initializer in `config/initializers/my_plugin.rb`.
35
-
36
- * There are a couple of new configuration changes you'd want to add in `config/environments/development.rb`:
37
-
38
- ```ruby
39
- # Raise exception on mass assignment protection for Active Record models
40
- config.active_record.mass_assignment_sanitizer = :strict
41
-
42
- # Log the query plan for queries taking more than this (works
43
- # with SQLite, MySQL, and PostgreSQL)
44
- config.active_record.auto_explain_threshold_in_seconds = 0.5
45
- ```
46
-
47
- The `mass_assignment_sanitizer` config also needs to be added in `config/environments/test.rb`:
48
-
49
- ```ruby
50
- # Raise exception on mass assignment protection for Active Record models
51
- config.active_record.mass_assignment_sanitizer = :strict
52
- ```
53
-
54
- ### What to update in your engines
55
-
56
- Replace the code beneath the comment in `script/rails` with the following content:
57
-
58
- ```ruby
59
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
60
- ENGINE_PATH = File.expand_path('../../lib/your_engine_name/engine', __FILE__)
61
-
62
- require 'rails/all'
63
- require 'rails/engine/commands'
64
- ```
65
-
66
- Creating a Rails 3.2 application
67
- --------------------------------
68
-
69
- ```bash
70
- # You should have the 'rails' RubyGem installed
71
- $ rails new myapp
72
- $ cd myapp
73
- ```
74
-
75
- ### Vendoring Gems
76
-
77
- Rails now uses a `Gemfile` in the application root to determine the gems you require for your application to start. This `Gemfile` is processed by the [Bundler](https://github.com/carlhuda/bundler) gem, which then installs all your dependencies. It can even install all the dependencies locally to your application so that it doesn't depend on the system gems.
78
-
79
- More information: [Bundler homepage](http://gembundler.com)
80
-
81
- ### Living on the Edge
82
-
83
- `Bundler` and `Gemfile` makes freezing your Rails application easy as pie with the new dedicated `bundle` command. If you want to bundle straight from the Git repository, you can pass the `--edge` flag:
84
-
85
- ```bash
86
- $ rails new myapp --edge
87
- ```
88
-
89
- If you have a local checkout of the Rails repository and want to generate an application using that, you can pass the `--dev` flag:
90
-
91
- ```bash
92
- $ ruby /path/to/rails/railties/bin/rails new myapp --dev
93
- ```
94
-
95
- Major Features
96
- --------------
97
-
98
- ### Faster Development Mode & Routing
99
-
100
- Rails 3.2 comes with a development mode that's noticeably faster. Inspired by [Active Reload](https://github.com/paneq/active_reload), Rails reloads classes only when files actually change. The performance gains are dramatic on a larger application. Route recognition also got a bunch faster thanks to the new [Journey](https://github.com/rails/journey) engine.
101
-
102
- ### Automatic Query Explains
103
-
104
- Rails 3.2 comes with a nice feature that explains queries generated by Arel by defining an `explain` method in `ActiveRecord::Relation`. For example, you can run something like `puts Person.active.limit(5).explain` and the query Arel produces is explained. This allows to check for the proper indexes and further optimizations.
105
-
106
- Queries that take more than half a second to run are *automatically* explained in the development mode. This threshold, of course, can be changed.
107
-
108
- ### Tagged Logging
109
-
110
- When running a multi-user, multi-account application, it's a great help to be able to filter the log by who did what. TaggedLogging in Active Support helps in doing exactly that by stamping log lines with subdomains, request ids, and anything else to aid debugging such applications.
111
-
112
- Documentation
113
- -------------
114
-
115
- From Rails 3.2, the Rails guides are available for the Kindle and free Kindle Reading Apps for the iPad, iPhone, Mac, Android, etc.
116
-
117
- Railties
118
- --------
119
-
120
- * Speed up development by only reloading classes if dependencies files changed. This can be turned off by setting `config.reload_classes_only_on_change` to false.
121
-
122
- * New applications get a flag `config.active_record.auto_explain_threshold_in_seconds` in the environments configuration files. With a value of `0.5` in `development.rb` and commented out in `production.rb`. No mention in `test.rb`.
123
-
124
- * Added `config.exceptions_app` to set the exceptions application invoked by the `ShowException` middleware when an exception happens. Defaults to `ActionDispatch::PublicExceptions.new(Rails.public_path)`.
125
-
126
- * Added a `DebugExceptions` middleware which contains features extracted from `ShowExceptions` middleware.
127
-
128
- * Display mounted engines' routes in `rake routes`.
129
-
130
- * Allow to change the loading order of railties with `config.railties_order` like:
131
-
132
- ```ruby
133
- config.railties_order = [Blog::Engine, :main_app, :all]
134
- ```
135
-
136
- * Scaffold returns 204 No Content for API requests without content. This makes scaffold work with jQuery out of the box.
137
-
138
- * Update `Rails::Rack::Logger` middleware to apply any tags set in `config.log_tags` to `ActiveSupport::TaggedLogging`. This makes it easy to tag log lines with debug information like subdomain and request id -- both very helpful in debugging multi-user production applications.
139
-
140
- * Default options to `rails new` can be set in `~/.railsrc`. You can specify extra command-line arguments to be used every time `rails new` runs in the `.railsrc` configuration file in your home directory.
141
-
142
- * Add an alias `d` for `destroy`. This works for engines too.
143
-
144
- * Attributes on scaffold and model generators default to string. This allows the following: `rails g scaffold Post title body:text author`
145
-
146
- * Allow scaffold/model/migration generators to accept "index" and "uniq" modifiers. For example,
147
-
148
- ```ruby
149
- rails g scaffold Post title:string:index author:uniq price:decimal{7,2}
150
- ```
151
-
152
- will create indexes for `title` and `author` with the latter being an unique index. Some types such as decimal accept custom options. In the example, `price` will be a decimal column with precision and scale set to 7 and 2 respectively.
153
-
154
- * Turn gem has been removed from default Gemfile.
155
-
156
- * Remove old plugin generator `rails generate plugin` in favor of `rails plugin new` command.
157
-
158
- * Remove old `config.paths.app.controller` API in favor of `config.paths["app/controller"]`.
159
-
160
- #### Deprecations
161
-
162
- * `Rails::Plugin` is deprecated and will be removed in Rails 4.0. Instead of adding plugins to `vendor/plugins` use gems or bundler with path or git dependencies.
163
-
164
- Action Mailer
165
- -------------
166
-
167
- * Upgraded `mail` version to 2.4.0.
168
-
169
- * Removed the old Action Mailer API which was deprecated since Rails 3.0.
170
-
171
- Action Pack
172
- -----------
173
-
174
- ### Action Controller
175
-
176
- * Make `ActiveSupport::Benchmarkable` a default module for `ActionController::Base,` so the `#benchmark` method is once again available in the controller context like it used to be.
177
-
178
- * Added `:gzip` option to `caches_page`. The default option can be configured globally using `page_cache_compression`.
179
-
180
- * Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail.
181
-
182
- ```ruby
183
- class CarsController
184
- layout 'single_car', :only => :show
185
- end
186
- ```
187
-
188
- Rails will use `layouts/single_car` when a request comes in `:show` action, and use `layouts/application` (or `layouts/cars`, if exists) when a request comes in for any other actions.
189
-
190
- * `form\_for` is changed to use `#{action}\_#{as}` as the css class and id if `:as` option is provided. Earlier versions used `#{as}\_#{action}`.
191
-
192
- * `ActionController::ParamsWrapper` on Active Record models now only wrap `attr_accessible` attributes if they were set. If not, only the attributes returned by the class method `attribute_names` will be wrapped. This fixes the wrapping of nested attributes by adding them to `attr_accessible`.
193
-
194
- * Log "Filter chain halted as CALLBACKNAME rendered or redirected" every time a before callback halts.
195
-
196
- * `ActionDispatch::ShowExceptions` is refactored. The controller is responsible for choosing to show exceptions. It's possible to override `show_detailed_exceptions?` in controllers to specify which requests should provide debugging information on errors.
197
-
198
- * Responders now return 204 No Content for API requests without a response body (as in the new scaffold).
199
-
200
- * `ActionController::TestCase` cookies is refactored. Assigning cookies for test cases should now use `cookies[]`
201
-
202
- ```ruby
203
- cookies[:email] = 'user@example.com'
204
- get :index
205
- assert_equal 'user@example.com', cookies[:email]
206
- ```
207
-
208
- To clear the cookies, use `clear`.
209
-
210
- ```ruby
211
- cookies.clear
212
- get :index
213
- assert_nil cookies[:email]
214
- ```
215
-
216
- We now no longer write out HTTP_COOKIE and the cookie jar is persistent between requests so if you need to manipulate the environment for your test you need to do it before the cookie jar is created.
217
-
218
- * `send_file` now guesses the MIME type from the file extension if `:type` is not provided.
219
-
220
- * MIME type entries for PDF, ZIP and other formats were added.
221
-
222
- * Allow `fresh_when/stale?` to take a record instead of an options hash.
223
-
224
- * Changed log level of warning for missing CSRF token from `:debug` to `:warn`.
225
-
226
- * Assets should use the request protocol by default or default to relative if no request is available.
227
-
228
- #### Deprecations
229
-
230
- * Deprecated implied layout lookup in controllers whose parent had an explicit layout set:
231
-
232
- ```ruby
233
- class ApplicationController
234
- layout "application"
235
- end
236
-
237
- class PostsController < ApplicationController
238
- end
239
- ```
240
-
241
- In the example above, `PostsController` will no longer automatically look up for a posts layout. If you need this functionality you could either remove `layout "application"` from `ApplicationController` or explicitly set it to `nil` in `PostsController`.
242
-
243
- * Deprecated `ActionController::UnknownAction` in favor of `AbstractController::ActionNotFound`.
244
-
245
- * Deprecated `ActionController::DoubleRenderError` in favor of `AbstractController::DoubleRenderError`.
246
-
247
- * Deprecated `method_missing` in favor of `action_missing` for missing actions.
248
-
249
- * Deprecated `ActionController#rescue_action`, `ActionController#initialize_template_class` and `ActionController#assign_shortcuts`.
250
-
251
- ### Action Dispatch
252
-
253
- * Add `config.action_dispatch.default_charset` to configure default charset for `ActionDispatch::Response`.
254
-
255
- * Added `ActionDispatch::RequestId` middleware that'll make a unique X-Request-Id header available to the response and enables the `ActionDispatch::Request#uuid` method. This makes it easy to trace requests from end-to-end in the stack and to identify individual requests in mixed logs like Syslog.
256
-
257
- * The `ShowExceptions` middleware now accepts an exceptions application that is responsible to render an exception when the application fails. The application is invoked with a copy of the exception in `env["action_dispatch.exception"]` and with the `PATH_INFO` rewritten to the status code.
258
-
259
- * Allow rescue responses to be configured through a railtie as in `config.action_dispatch.rescue_responses`.
260
-
261
- #### Deprecations
262
-
263
- * Deprecated the ability to set a default charset at the controller level, use the new `config.action_dispatch.default_charset` instead.
264
-
265
- ### Action View
266
-
267
- * Add `button_tag` support to `ActionView::Helpers::FormBuilder`. This support mimics the default behavior of `submit_tag`.
268
-
269
- ```erb
270
- <%= form_for @post do |f| %>
271
- <%= f.button %>
272
- <% end %>
273
- ```
274
-
275
- * Date helpers accept a new option `:use_two_digit_numbers => true`, that renders select boxes for months and days with a leading zero without changing the respective values. For example, this is useful for displaying ISO 8601-style dates such as '2011-08-01'.
276
-
277
- * You can provide a namespace for your form to ensure uniqueness of id attributes on form elements. The namespace attribute will be prefixed with underscore on the generated HTML id.
278
-
279
- ```erb
280
- <%= form_for(@offer, :namespace => 'namespace') do |f| %>
281
- <%= f.label :version, 'Version' %>:
282
- <%= f.text_field :version %>
283
- <% end %>
284
- ```
285
-
286
- * Limit the number of options for `select_year` to 1000. Pass `:max_years_allowed` option to set your own limit.
287
-
288
- * `content_tag_for` and `div_for` can now take a collection of records. It will also yield the record as the first argument if you set a receiving argument in your block. So instead of having to do this:
289
-
290
- ```ruby
291
- @items.each do |item|
292
- content_tag_for(:li, item) do
293
- Title: <%= item.title %>
294
- end
295
- end
296
- ```
297
-
298
- You can do this:
299
-
300
- ```ruby
301
- content_tag_for(:li, @items) do |item|
302
- Title: <%= item.title %>
303
- end
304
- ```
305
-
306
- * Added `font_path` helper method that computes the path to a font asset in `public/fonts`.
307
-
308
- #### Deprecations
309
-
310
- * Passing formats or handlers to render :template and friends like `render :template => "foo.html.erb"` is deprecated. Instead, you can provide :handlers and :formats directly as options: ` render :template => "foo", :formats => [:html, :js], :handlers => :erb`.
311
-
312
- ### Sprockets
313
-
314
- * Adds a configuration option `config.assets.logger` to control Sprockets logging. Set it to `false` to turn off logging and to `nil` to default to `Rails.logger`.
315
-
316
- Active Record
317
- -------------
318
-
319
- * Boolean columns with 'on' and 'ON' values are type cast to true.
320
-
321
- * When the `timestamps` method creates the `created_at` and `updated_at` columns, it makes them non-nullable by default.
322
-
323
- * Implemented `ActiveRecord::Relation#explain`.
324
-
325
- * Implements `AR::Base.silence_auto_explain` which allows the user to selectively disable automatic EXPLAINs within a block.
326
-
327
- * Implements automatic EXPLAIN logging for slow queries. A new configuration parameter `config.active_record.auto_explain_threshold_in_seconds` determines what's to be considered a slow query. Setting that to nil disables this feature. Defaults are 0.5 in development mode, and nil in test and production modes. Rails 3.2 supports this feature in SQLite, MySQL (mysql2 adapter), and PostgreSQL.
328
-
329
- * Added `ActiveRecord::Base.store` for declaring simple single-column key/value stores.
330
-
331
- ```ruby
332
- class User < ActiveRecord::Base
333
- store :settings, accessors: [ :color, :homepage ]
334
- end
335
-
336
- u = User.new(color: 'black', homepage: '37signals.com')
337
- u.color # Accessor stored attribute
338
- u.settings[:country] = 'Denmark' # Any attribute, even if not specified with an accessor
339
- ```
340
-
341
- * Added ability to run migrations only for a given scope, which allows to run migrations only from one engine (for example to revert changes from an engine that need to be removed).
342
-
343
- ```
344
- rake db:migrate SCOPE=blog
345
- ```
346
-
347
- * Migrations copied from engines are now scoped with engine's name, for example `01_create_posts.blog.rb`.
348
-
349
- * Implemented `ActiveRecord::Relation#pluck` method that returns an array of column values directly from the underlying table. This also works with serialized attributes.
350
-
351
- ```ruby
352
- Client.where(:active => true).pluck(:id)
353
- # SELECT id from clients where active = 1
354
- ```
355
-
356
- * Generated association methods are created within a separate module to allow overriding and composition. For a class named MyModel, the module is named `MyModel::GeneratedFeatureMethods`. It is included into the model class immediately after the `generated_attributes_methods` module defined in Active Model, so association methods override attribute methods of the same name.
357
-
358
- * Add `ActiveRecord::Relation#uniq` for generating unique queries.
359
-
360
- ```ruby
361
- Client.select('DISTINCT name')
362
- ```
363
-
364
- ..can be written as:
365
-
366
- ```ruby
367
- Client.select(:name).uniq
368
- ```
369
-
370
- This also allows you to revert the uniqueness in a relation:
371
-
372
- ```ruby
373
- Client.select(:name).uniq.uniq(false)
374
- ```
375
-
376
- * Support index sort order in SQLite, MySQL and PostgreSQL adapters.
377
-
378
- * Allow the `:class_name` option for associations to take a symbol in addition to a string. This is to avoid confusing newbies, and to be consistent with the fact that other options like `:foreign_key` already allow a symbol or a string.
379
-
380
- ```ruby
381
- has_many :clients, :class_name => :Client # Note that the symbol need to be capitalized
382
- ```
383
-
384
- * In development mode, `db:drop` also drops the test database in order to be symmetric with `db:create`.
385
-
386
- * Case-insensitive uniqueness validation avoids calling LOWER in MySQL when the column already uses a case-insensitive collation.
387
-
388
- * Transactional fixtures enlist all active database connections. You can test models on different connections without disabling transactional fixtures.
389
-
390
- * Add `first_or_create`, `first_or_create!`, `first_or_initialize` methods to Active Record. This is a better approach over the old `find_or_create_by` dynamic methods because it's clearer which arguments are used to find the record and which are used to create it.
391
-
392
- ```ruby
393
- User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson")
394
- ```
395
-
396
- * Added a `with_lock` method to Active Record objects, which starts a transaction, locks the object (pessimistically) and yields to the block. The method takes one (optional) parameter and passes it to `lock!`.
397
-
398
- This makes it possible to write the following:
399
-
400
- ```ruby
401
- class Order < ActiveRecord::Base
402
- def cancel!
403
- transaction do
404
- lock!
405
- # ... cancelling logic
406
- end
407
- end
408
- end
409
- ```
410
-
411
- as:
412
-
413
- ```ruby
414
- class Order < ActiveRecord::Base
415
- def cancel!
416
- with_lock do
417
- # ... cancelling logic
418
- end
419
- end
420
- end
421
- ```
422
-
423
- ### Deprecations
424
-
425
- * Automatic closure of connections in threads is deprecated. For example the following code is deprecated:
426
-
427
- ```ruby
428
- Thread.new { Post.find(1) }.join
429
- ```
430
-
431
- It should be changed to close the database connection at the end of the thread:
432
-
433
- ```ruby
434
- Thread.new {
435
- Post.find(1)
436
- Post.connection.close
437
- }.join
438
- ```
439
-
440
- Only people who spawn threads in their application code need to worry about this change.
441
-
442
- * The `set_table_name`, `set_inheritance_column`, `set_sequence_name`, `set_primary_key`, `set_locking_column` methods are deprecated. Use an assignment method instead. For example, instead of `set_table_name`, use `self.table_name=`.
443
-
444
- ```ruby
445
- class Project < ActiveRecord::Base
446
- self.table_name = "project"
447
- end
448
- ```
449
-
450
- Or define your own `self.table_name` method:
451
-
452
- ```ruby
453
- class Post < ActiveRecord::Base
454
- def self.table_name
455
- "special_" + super
456
- end
457
- end
458
-
459
- Post.table_name # => "special_posts"
460
-
461
- ```
462
-
463
- Active Model
464
- ------------
465
-
466
- * Add `ActiveModel::Errors#added?` to check if a specific error has been added.
467
-
468
- * Add ability to define strict validations with `strict => true` that always raises exception when fails.
469
-
470
- * Provide mass_assignment_sanitizer as an easy API to replace the sanitizer behavior. Also support both :logger (default) and :strict sanitizer behavior.
471
-
472
- ### Deprecations
473
-
474
- * Deprecated `define_attr_method` in `ActiveModel::AttributeMethods` because this only existed to support methods like `set_table_name` in Active Record, which are themselves being deprecated.
475
-
476
- * Deprecated `Model.model_name.partial_path` in favor of `model.to_partial_path`.
477
-
478
- Active Resource
479
- ---------------
480
-
481
- * Redirect responses: 303 See Other and 307 Temporary Redirect now behave like 301 Moved Permanently and 302 Found.
482
-
483
- Active Support
484
- --------------
485
-
486
- * Added `ActiveSupport:TaggedLogging` that can wrap any standard `Logger` class to provide tagging capabilities.
487
-
488
- ```ruby
489
- Logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
490
-
491
- Logger.tagged("BCX") { Logger.info "Stuff" }
492
- # Logs "[BCX] Stuff"
493
-
494
- Logger.tagged("BCX", "Jason") { Logger.info "Stuff" }
495
- # Logs "[BCX] [Jason] Stuff"
496
-
497
- Logger.tagged("BCX") { Logger.tagged("Jason") { Logger.info "Stuff" } }
498
- # Logs "[BCX] [Jason] Stuff"
499
- ```
500
-
501
- * The `beginning_of_week` method in `Date`, `Time` and `DateTime` accepts an optional argument representing the day in which the week is assumed to start.
502
-
503
- * `ActiveSupport::Notifications.subscribed` provides subscriptions to events while a block runs.
504
-
505
- * Defined new methods `Module#qualified_const_defined?`, `Module#qualified_const_get` and `Module#qualified_const_set` that are analogous to the corresponding methods in the standard API, but accept qualified constant names.
506
-
507
- * Added `#deconstantize` which complements `#demodulize` in inflections. This removes the rightmost segment in a qualified constant name.
508
-
509
- * Added `safe_constantize` that constantizes a string but returns `nil` instead of raising an exception if the constant (or part of it) does not exist.
510
-
511
- * `ActiveSupport::OrderedHash` is now marked as extractable when using `Array#extract_options!`.
512
-
513
- * Added `Array#prepend` as an alias for `Array#unshift` and `Array#append` as an alias for `Array#<<`.
514
-
515
- * The definition of a blank string for Ruby 1.9 has been extended to Unicode whitespace. Also, in Ruby 1.8 the ideographic space U`3000 is considered to be whitespace.
516
-
517
- * The inflector understands acronyms.
518
-
519
- * Added `Time#all_day`, `Time#all_week`, `Time#all_quarter` and `Time#all_year` as a way of generating ranges.
520
-
521
- ```ruby
522
- Event.where(:created_at => Time.now.all_week)
523
- Event.where(:created_at => Time.now.all_day)
524
- ```
525
-
526
- * Added `instance_accessor: false` as an option to `Class#cattr_accessor` and friends.
527
-
528
- * `ActiveSupport::OrderedHash` now has different behavior for `#each` and `#each_pair` when given a block accepting its parameters with a splat.
529
-
530
- * Added `ActiveSupport::Cache::NullStore` for use in development and testing.
531
-
532
- * Removed `ActiveSupport::SecureRandom` in favor of `SecureRandom` from the standard library.
533
-
534
- ### Deprecations
535
-
536
- * `ActiveSupport::Base64` is deprecated in favor of `::Base64`.
537
-
538
- * Deprecated `ActiveSupport::Memoizable` in favor of Ruby memoization pattern.
539
-
540
- * `Module#synchronize` is deprecated with no replacement. Please use monitor from ruby's standard library.
541
-
542
- * Deprecated `ActiveSupport::MessageEncryptor#encrypt` and `ActiveSupport::MessageEncryptor#decrypt`.
543
-
544
- * `ActiveSupport::BufferedLogger#silence` is deprecated. If you want to squelch logs for a certain block, change the log level for that block.
545
-
546
- * `ActiveSupport::BufferedLogger#open_log` is deprecated. This method should not have been public in the first place.
547
-
548
- * `ActiveSupport::BufferedLogger's` behavior of automatically creating the directory for your log file is deprecated. Please make sure to create the directory for your log file before instantiating.
549
-
550
- * `ActiveSupport::BufferedLogger#auto_flushing` is deprecated. Either set the sync level on the underlying file handle like this. Or tune your filesystem. The FS cache is now what controls flushing.
551
-
552
- ```ruby
553
- f = File.open('foo.log', 'w')
554
- f.sync = true
555
- ActiveSupport::BufferedLogger.new f
556
- ```
557
-
558
- * `ActiveSupport::BufferedLogger#flush` is deprecated. Set sync on your filehandle, or tune your filesystem.
559
-
560
- Credits
561
- -------
562
-
563
- See the [full list of contributors to Rails](http://contributors.rubyonrails.org/) for the many people who spent many hours making Rails, the stable and robust framework it is. Kudos to all of them.
564
-
565
- Rails 3.2 Release Notes were compiled by [Vijay Dev](https://github.com/vijaydev.)