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.

Potentially problematic release.


This version of rails might be problematic. Click here for more details.

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,544 +0,0 @@
1
- Contributing to Ruby on Rails
2
- =============================
3
-
4
- This guide covers ways in which _you_ can become a part of the ongoing development of Ruby on Rails.
5
-
6
- After reading this guide, you will know:
7
-
8
- * How to use GitHub to report issues.
9
- * How to clone master and run the test suite.
10
- * How to help resolve existing issues.
11
- * How to contribute to the Ruby on Rails documentation.
12
- * How to contribute to the Ruby on Rails code.
13
-
14
- Ruby on Rails is not "someone else's framework." Over the years, hundreds of people have contributed to Ruby on Rails ranging from a single character to massive architectural changes or significant documentation - all with the goal of making Ruby on Rails better for everyone. Even if you don't feel up to writing code or documentation yet, there are a variety of other ways that you can contribute, from reporting issues to testing patches.
15
-
16
- --------------------------------------------------------------------------------
17
-
18
- Reporting an Issue
19
- ------------------
20
-
21
- Ruby on Rails uses [GitHub Issue Tracking](https://github.com/rails/rails/issues) to track issues (primarily bugs and contributions of new code). If you've found a bug in Ruby on Rails, this is the place to start. You'll need to create a (free) GitHub account in order to submit an issue, to comment on them or to create pull requests.
22
-
23
- NOTE: Bugs in the most recent released version of Ruby on Rails are likely to get the most attention. Also, the Rails core team is always interested in feedback from those who can take the time to test _edge Rails_ (the code for the version of Rails that is currently under development). Later in this guide you'll find out how to get edge Rails for testing.
24
-
25
- ### Creating a Bug Report
26
-
27
- If you've found a problem in Ruby on Rails which is not a security risk, do a search in GitHub under [Issues](https://github.com/rails/rails/issues) in case it was already reported. If you find no issue addressing it you can [add a new one](https://github.com/rails/rails/issues/new). (See the next section for reporting security issues.)
28
-
29
- At the minimum, your issue report needs a title and descriptive text. But that's only a minimum. You should include as much relevant information as possible. You need at least to post the code sample that has the issue. Even better is to include a unit test that shows how the expected behavior is not occurring. Your goal should be to make it easy for yourself - and others - to replicate the bug and figure out a fix.
30
-
31
- Then, don't get your hopes up! Unless you have a "Code Red, Mission Critical, the World is Coming to an End" kind of bug, you're creating this issue report in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the issue report will automatically see any activity or that others will jump to fix it. Creating an issue like this is mostly to help yourself start on the path of fixing the problem and for others to confirm it with an "I'm having this problem too" comment.
32
-
33
- ### Create a Self-Contained gist for Active Record and Action Controller Issues
34
-
35
- If you are filing a bug report, please use
36
- [Active Record template for gems](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb) or
37
- [Action Controller template for gems](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_gem.rb)
38
- if the bug is found in a published gem, and
39
- [Active Record template for master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_master.rb) or
40
- [Action Controller template for master](https://github.com/rails/rails/blob/master/guides/bug_report_templates/action_controller_master.rb)
41
- if the bug happens in the master branch.
42
-
43
- ### Special Treatment for Security Issues
44
-
45
- WARNING: Please do not report security vulnerabilities with public GitHub issue reports. The [Rails security policy page](http://rubyonrails.org/security) details the procedure to follow for security issues.
46
-
47
- ### What about Feature Requests?
48
-
49
- Please don't put "feature request" items into GitHub Issues. If there's a new
50
- feature that you want to see added to Ruby on Rails, you'll need to write the
51
- code yourself - or convince someone else to partner with you to write the code.
52
- Later in this guide you'll find detailed instructions for proposing a patch to
53
- Ruby on Rails. If you enter a wishlist item in GitHub Issues with no code, you
54
- can expect it to be marked "invalid" as soon as it's reviewed.
55
-
56
- Sometimes, the line between 'bug' and 'feature' is a hard one to draw.
57
- Generally, a feature is anything that adds new behavior, while a bug is
58
- anything that fixes already existing behavior that is misbehaving. Sometimes,
59
- the core team will have to make a judgement call. That said, the distinction
60
- generally just affects which release your patch will get in to; we love feature
61
- submissions! They just won't get backported to maintenance branches.
62
-
63
- If you'd like feedback on an idea for a feature before doing the work for make
64
- a patch, please send an email to the [rails-core mailing
65
- list](https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core). You
66
- might get no response, which means that everyone is indifferent. You might find
67
- someone who's also interested in building that feature. You might get a "This
68
- won't be accepted." But it's the proper place to discuss new ideas. GitHub
69
- Issues are not a particularly good venue for the sometimes long and involved
70
- discussions new features require.
71
-
72
- Setting Up a Development Environment
73
- ------------------------------------
74
-
75
- To move on from submitting bugs to helping resolve existing issues or contributing your own code to Ruby on Rails, you _must_ be able to run its test suite. In this section of the guide you'll learn how to set up the tests on your own computer.
76
-
77
- ### The Easy Way
78
-
79
- The easiest and recommended way to get a development environment ready to hack is to use the [Rails development box](https://github.com/rails/rails-dev-box).
80
-
81
- ### The Hard Way
82
-
83
- In case you can't use the Rails development box, see section above, check [this other guide](development_dependencies_install.html).
84
-
85
-
86
- Running an Application Against Your Local Branch
87
- ------------------------------------------------
88
-
89
- The `--dev` flag of `rails new` generates an application that uses your local
90
- branch:
91
-
92
- ```bash
93
- $ cd rails
94
- $ bundle exec rails new ~/my-test-app --dev
95
- ```
96
-
97
- The application generated in `~/my-test-app` runs against your local branch
98
- and in particular sees any modifications upon server reboot.
99
-
100
-
101
- Testing Active Record
102
- ---------------------
103
-
104
- This is how you run the Active Record test suite only for SQLite3:
105
-
106
- ```bash
107
- $ cd activerecord
108
- $ bundle exec rake test_sqlite3
109
- ```
110
-
111
- You can now run the tests as you did for `sqlite3`. The tasks are respectively
112
-
113
- ```bash
114
- test_mysql
115
- test_mysql2
116
- test_postgresql
117
- ```
118
-
119
- Finally,
120
-
121
- ```bash
122
- $ bundle exec rake test
123
- ```
124
-
125
- will now run the four of them in turn.
126
-
127
- You can also run any single test separately:
128
-
129
- ```bash
130
- $ ARCONN=sqlite3 ruby -Itest test/cases/associations/has_many_associations_test.rb
131
- ```
132
-
133
- You can invoke `test_jdbcmysql`, `test_jdbcsqlite3` or `test_jdbcpostgresql` also. See the file `activerecord/RUNNING_UNIT_TESTS.rdoc` for information on running more targeted database tests, or the file `ci/travis.rb` for the test suite run by the continuous integration server.
134
-
135
- ### Warnings
136
-
137
- The test suite runs with warnings enabled. Ideally, Ruby on Rails should issue no warnings, but there may be a few, as well as some from third-party libraries. Please ignore (or fix!) them, if any, and submit patches that do not issue new warnings.
138
-
139
- If you are sure about what you are doing and would like to have a more clear output, there's a way to override the flag:
140
-
141
- ```bash
142
- $ RUBYOPT=-W0 bundle exec rake test
143
- ```
144
-
145
- ### Older Versions of Ruby on Rails
146
-
147
- If you want to add a fix to older versions of Ruby on Rails, you'll need to set up and switch to your own local tracking branch. Here is an example to switch to the 3-0-stable branch:
148
-
149
- ```bash
150
- $ git branch --track 3-0-stable origin/3-0-stable
151
- $ git checkout 3-0-stable
152
- ```
153
-
154
- TIP: You may want to [put your Git branch name in your shell prompt](http://qugstart.com/blog/git-and-svn/add-colored-git-branch-name-to-your-shell-prompt/) to make it easier to remember which version of the code you're working with.
155
-
156
- Helping to Resolve Existing Issues
157
- ----------------------------------
158
-
159
- As a next step beyond reporting issues, you can help the core team resolve existing issues. If you check the [Everyone's Issues](https://github.com/rails/rails/issues) list in GitHub Issues, you'll find lots of issues already requiring attention. What can you do for these? Quite a bit, actually:
160
-
161
- ### Verifying Bug Reports
162
-
163
- For starters, it helps just to verify bug reports. Can you reproduce the reported issue on your own computer? If so, you can add a comment to the issue saying that you're seeing the same thing.
164
-
165
- If something is very vague, can you help squash it down into something specific? Maybe you can provide additional information to help reproduce a bug, or help by eliminating needless steps that aren't required to demonstrate the problem.
166
-
167
- If you find a bug report without a test, it's very useful to contribute a failing test. This is also a great way to get started exploring the source code: looking at the existing test files will teach you how to write more tests. New tests are best contributed in the form of a patch, as explained later on in the "Contributing to the Rails Code" section.
168
-
169
- Anything you can do to make bug reports more succinct or easier to reproduce is a help to folks trying to write code to fix those bugs - whether you end up writing the code yourself or not.
170
-
171
- ### Testing Patches
172
-
173
- You can also help out by examining pull requests that have been submitted to Ruby on Rails via GitHub. To apply someone's changes you need first to create a dedicated branch:
174
-
175
- ```bash
176
- $ git checkout -b testing_branch
177
- ```
178
-
179
- Then you can use their remote branch to update your codebase. For example, let's say the GitHub user JohnSmith has forked and pushed to a topic branch "orange" located at https://github.com/JohnSmith/rails.
180
-
181
- ```bash
182
- $ git remote add JohnSmith git://github.com/JohnSmith/rails.git
183
- $ git pull JohnSmith orange
184
- ```
185
-
186
- After applying their branch, test it out! Here are some things to think about:
187
-
188
- * Does the change actually work?
189
- * Are you happy with the tests? Can you follow what they're testing? Are there any tests missing?
190
- * Does it have the proper documentation coverage? Should documentation elsewhere be updated?
191
- * Do you like the implementation? Can you think of a nicer or faster way to implement a part of their change?
192
-
193
- Once you're happy that the pull request contains a good change, comment on the GitHub issue indicating your approval. Your comment should indicate that you like the change and what you like about it. Something like:
194
-
195
- <blockquote>
196
- I like the way you've restructured that code in generate_finder_sql - much nicer. The tests look good too.
197
- </blockquote>
198
-
199
- If your comment simply says "+1", then odds are that other reviewers aren't going to take it too seriously. Show that you took the time to review the pull request.
200
-
201
- Contributing to the Rails Documentation
202
- ---------------------------------------
203
-
204
- Ruby on Rails has two main sets of documentation: the guides, which help you
205
- learn about Ruby on Rails, and the API, which serves as a reference.
206
-
207
- You can help improve the Rails guides by making them more coherent, consistent or readable, adding missing information, correcting factual errors, fixing typos, or bringing it up to date with the latest edge Rails. To get involved in the translation of Rails guides, please see [Translating Rails Guides](https://wiki.github.com/rails/docrails/translating-rails-guides).
208
-
209
- You can either open a pull request to [Rails](http://github.com/rails/rails) or
210
- ask the [Rails core team](http://rubyonrails.org/core) for commit access on
211
- [docrails](http://github.com/rails/docrails) if you contribute regularly.
212
- Please do not open pull requests in docrails, if you'd like to get feedback on your
213
- change, ask for it in [Rails](http://github.com/rails/rails) instead.
214
-
215
- Docrails is merged with master regularly, so you are effectively editing the Ruby on Rails documentation.
216
-
217
- If you are unsure of the documentation changes, you can create an issue in the [Rails](https://github.com/rails/rails/issues) issues tracker on GitHub.
218
-
219
- When working with documentation, please take into account the [API Documentation Guidelines](api_documentation_guidelines.html) and the [Ruby on Rails Guides Guidelines](ruby_on_rails_guides_guidelines.html).
220
-
221
- NOTE: As explained earlier, ordinary code patches should have proper documentation coverage. Docrails is only used for isolated documentation improvements.
222
-
223
- NOTE: To help our CI servers you should add [ci skip] to your documentation commit message to skip build on that commit. Please remember to use it for commits containing only documentation changes.
224
-
225
- WARNING: Docrails has a very strict policy: no code can be touched whatsoever, no matter how trivial or small the change. Only RDoc and guides can be edited via docrails. Also, CHANGELOGs should never be edited in docrails.
226
-
227
- Contributing to the Rails Code
228
- ------------------------------
229
-
230
- ### Clone the Rails Repository
231
-
232
- The first thing you need to do to be able to contribute code is to clone the repository:
233
-
234
- ```bash
235
- $ git clone git://github.com/rails/rails.git
236
- ```
237
-
238
- and create a dedicated branch:
239
-
240
- ```bash
241
- $ cd rails
242
- $ git checkout -b my_new_branch
243
- ```
244
-
245
- It doesn't matter much what name you use, because this branch will only exist on your local computer and your personal repository on GitHub. It won't be part of the Rails Git repository.
246
-
247
- ### Write Your Code
248
-
249
- Now get busy and add or edit code. You're on your branch now, so you can write whatever you want (you can check to make sure you're on the right branch with `git branch -a`). But if you're planning to submit your change back for inclusion in Rails, keep a few things in mind:
250
-
251
- * Get the code right.
252
- * Use Rails idioms and helpers.
253
- * Include tests that fail without your code, and pass with it.
254
- * Update the (surrounding) documentation, examples elsewhere, and the guides: whatever is affected by your contribution.
255
-
256
- It is not customary in Rails to run the full test suite before pushing
257
- changes. The railties test suite in particular takes a long time, and even
258
- more if the source code is mounted in `/vagrant` as happens in the recommended
259
- workflow with the [rails-dev-box](https://github.com/rails/rails-dev-box).
260
-
261
- As a compromise, test what your code obviously affects, and if the change is
262
- not in railties, run the whole test suite of the affected component. If all
263
- tests are passing, that's enough to propose your contribution. We have
264
- [Travis CI](https://travis-ci.org/rails/rails) as a safety net for catching
265
- unexpected breakages elsewhere.
266
-
267
- TIP: Changes that are cosmetic in nature and do not add anything substantial to the stability, functionality, or testability of Rails will generally not be accepted.
268
-
269
- ### Follow the Coding Conventions
270
-
271
- Rails follows a simple set of coding style conventions:
272
-
273
- * Two spaces, no tabs (for indentation).
274
- * No trailing whitespace. Blank lines should not have any spaces.
275
- * Indent after private/protected.
276
- * Use Ruby >= 1.9 syntax for hashes. Prefer `{ a: :b }` over `{ :a => :b }`.
277
- * Prefer `&&`/`||` over `and`/`or`.
278
- * Prefer class << self over self.method for class methods.
279
- * Use `MyClass.my_method(my_arg)` not `my_method( my_arg )` or `my_method my_arg`.
280
- * Use `a = b` and not `a=b`.
281
- * Use assert_not methods instead of refute.
282
- * Prefer `method { do_stuff }` instead of `method{do_stuff}` for single-line blocks.
283
- * Follow the conventions in the source you see used already.
284
-
285
- The above are guidelines - please use your best judgment in using them.
286
-
287
- ### Updating the CHANGELOG
288
-
289
- The CHANGELOG is an important part of every release. It keeps the list of changes for every Rails version.
290
-
291
- You should add an entry to the CHANGELOG of the framework that you modified if you're adding or removing a feature, committing a bug fix or adding deprecation notices. Refactorings and documentation changes generally should not go to the CHANGELOG.
292
-
293
- A CHANGELOG entry should summarize what was changed and should end with author's name and it should go on top of a CHANGELOG. You can use multiple lines if you need more space and you can attach code examples indented with 4 spaces. If a change is related to a specific issue, you should attach issue's number. Here is an example CHANGELOG entry:
294
-
295
- ```
296
- * Summary of a change that briefly describes what was changed. You can use multiple
297
- lines and wrap them at around 80 characters. Code examples are ok, too, if needed:
298
-
299
- class Foo
300
- def bar
301
- puts 'baz'
302
- end
303
- end
304
-
305
- You can continue after the code example and you can attach issue number. GH#1234
306
-
307
- *Your Name*
308
- ```
309
-
310
- Your name can be added directly after the last word if you don't provide any code examples or don't need multiple paragraphs. Otherwise, it's best to make as a new paragraph.
311
-
312
- ### Sanity Check
313
-
314
- You should not be the only person who looks at the code before you submit it.
315
- If you know someone else who uses Rails, try asking them if they'll check out
316
- your work. If you don't know anyone else using Rails, try hopping into the IRC
317
- room or posting about your idea to the rails-core mailing list. Doing this in
318
- private before you push a patch out publicly is the “smoke test” for a patch:
319
- if you can’t convince one other developer of the beauty of your code, you’re
320
- unlikely to convince the core team either.
321
-
322
- ### Commit Your Changes
323
-
324
- When you're happy with the code on your computer, you need to commit the changes to Git:
325
-
326
- ```bash
327
- $ git commit -a
328
- ```
329
-
330
- At this point, your editor should be fired up and you can write a message for this commit. Well formatted and descriptive commit messages are extremely helpful for the others, especially when figuring out why given change was made, so please take the time to write it.
331
-
332
- Good commit message should be formatted according to the following example:
333
-
334
- ```
335
- Short summary (ideally 50 characters or less)
336
-
337
- More detailed description, if necessary. It should be wrapped to 72
338
- characters. Try to be as descriptive as you can, even if you think that
339
- the commit content is obvious, it may not be obvious to others. You
340
- should add such description also if it's already present in bug tracker,
341
- it should not be necessary to visit a webpage to check the history.
342
-
343
- Description can have multiple paragraphs and you can use code examples
344
- inside, just indent it with 4 spaces:
345
-
346
- class PostsController
347
- def index
348
- respond_with Post.limit(10)
349
- end
350
- end
351
-
352
- You can also add bullet points:
353
-
354
- - you can use dashes or asterisks
355
-
356
- - also, try to indent next line of a point for readability, if it's too
357
- long to fit in 72 characters
358
- ```
359
-
360
- TIP. Please squash your commits into a single commit when appropriate. This simplifies future cherry picks, and also keeps the git log clean.
361
-
362
- ### Update Your Branch
363
-
364
- It's pretty likely that other changes to master have happened while you were working. Go get them:
365
-
366
- ```bash
367
- $ git checkout master
368
- $ git pull --rebase
369
- ```
370
-
371
- Now reapply your patch on top of the latest changes:
372
-
373
- ```bash
374
- $ git checkout my_new_branch
375
- $ git rebase master
376
- ```
377
-
378
- No conflicts? Tests still pass? Change still seems reasonable to you? Then move on.
379
-
380
- ### Fork
381
-
382
- Navigate to the Rails [GitHub repository](https://github.com/rails/rails) and press "Fork" in the upper right hand corner.
383
-
384
- Add the new remote to your local repository on your local machine:
385
-
386
- ```bash
387
- $ git remote add mine git@github.com:<your user name>/rails.git
388
- ```
389
-
390
- Push to your remote:
391
-
392
- ```bash
393
- $ git push mine my_new_branch
394
- ```
395
-
396
- You might have cloned your forked repository into your machine and might want to add the original Rails repository as a remote instead, if that's the case here's what you have to do.
397
-
398
- In the directory you cloned your fork:
399
-
400
- ```bash
401
- $ git remote add rails git://github.com/rails/rails.git
402
- ```
403
-
404
- Download new commits and branches from the official repository:
405
-
406
- ```bash
407
- $ git fetch rails
408
- ```
409
-
410
- Merge the new content:
411
-
412
- ```bash
413
- $ git checkout master
414
- $ git rebase rails/master
415
- ```
416
-
417
- Update your fork:
418
-
419
- ```bash
420
- $ git push origin master
421
- ```
422
-
423
- If you want to update another branch:
424
-
425
- ```bash
426
- $ git checkout branch_name
427
- $ git rebase rails/branch_name
428
- $ git push origin branch_name
429
- ```
430
-
431
-
432
- ### Issue a Pull Request
433
-
434
- Navigate to the Rails repository you just pushed to (e.g.
435
- https://github.com/your-user-name/rails) and click on "Pull Requests" seen in
436
- the right panel. On the next page, press "New pull request" in the upper right
437
- hand corner.
438
-
439
- Click on "Edit", if you need to change the branches being compared (it compares
440
- "master" by default) and press "Click to create a pull request for this
441
- comparison".
442
-
443
- Ensure the changesets you introduced are included. Fill in some details about
444
- your potential patch including a meaningful title. When finished, press "Send
445
- pull request". The Rails core team will be notified about your submission.
446
-
447
- ### Get some Feedback
448
-
449
- Most pull requests will go through a few iterations before they get merged.
450
- Different contributors will sometimes have different opinions, and often
451
- patches will need revised before they can get merged.
452
-
453
- Some contributors to Rails have email notifications from GitHub turned on, but
454
- others do not. Furthermore, (almost) everyone who works on Rails is a
455
- volunteer, and so it may take a few days for you to get your first feedback on
456
- a pull request. Don't despair! Sometimes it's quick, sometimes it's slow. Such
457
- is the open source life.
458
-
459
- If it's been over a week, and you haven't heard anything, you might want to try
460
- and nudge things along. You can use the [rubyonrails-core mailing
461
- list](http://groups.google.com/group/rubyonrails-core/) for this. You can also
462
- leave another comment on the pull request.
463
-
464
- While you're waiting for feedback on your pull request, open up a few other
465
- pull requests and give someone else some! I'm sure they'll appreciate it in
466
- the same way that you appreciate feedback on your patches.
467
-
468
- ### Iterate as Necessary
469
-
470
- It's entirely possible that the feedback you get will suggest changes. Don't get discouraged: the whole point of contributing to an active open source project is to tap into community knowledge. If people are encouraging you to tweak your code, then it's worth making the tweaks and resubmitting. If the feedback is that your code doesn't belong in the core, you might still think about releasing it as a gem.
471
-
472
- #### Squashing commits
473
-
474
- One of the things that we may ask you to do is "squash your commits," which
475
- will combine all of your commits into a single commit. We prefer pull requests
476
- that are a single commit. This makes it easier to backport changes to stable
477
- branches, squashing makes it easier to revert bad commits, and the git history
478
- can be a bit easier to follow. Rails is a large project, and a bunch of
479
- extraneous commits can add a lot of noise.
480
-
481
- In order to do this, you'll need to have a git remote that points at the main
482
- Rails repository. This is useful anyway, but just in case you don't have it set
483
- up, make sure that you do this first:
484
-
485
- ```bash
486
- $ git remote add upstream https://github.com/rails/rails.git
487
- ```
488
-
489
- You can call this remote whatever you'd like, but if you don't use `upstream`,
490
- then change the name to your own in the instructions below.
491
-
492
- Given that your remote branch is called `my_pull_request`, then you can do the
493
- following:
494
-
495
- ```bash
496
- $ git fetch upstream
497
- $ git checkout my_pull_request
498
- $ git rebase upstream/master
499
- $ git rebase -i
500
-
501
- < Choose 'squash' for all of your commits except the first one. >
502
- < Edit the commit message to make sense, and describe all your changes. >
503
-
504
- $ git push origin my_pull_request -f
505
- ```
506
-
507
- You should be able to refresh the pull request on GitHub and see that it has
508
- been updated.
509
-
510
- ### Backporting
511
-
512
- Changes that are merged into master are intended for the next major release of Rails. Sometimes, it might be beneficial for your changes to propagate back to the maintenance releases for older stable branches. Generally, security fixes and bug fixes are good candidates for a backport, while new features and patches that introduce a change in behavior will not be accepted. When in doubt, it is best to consult a Rails team member before backporting your changes to avoid wasted effort.
513
-
514
- For simple fixes, the easiest way to backport your changes is to [extract a diff from your changes in master and apply them to the target branch](http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git).
515
-
516
- First make sure your changes are the only difference between your current branch and master:
517
-
518
- ```bash
519
- $ git log master..HEAD
520
- ```
521
-
522
- Then extract the diff:
523
-
524
- ```bash
525
- $ git format-patch master --stdout > ~/my_changes.patch
526
- ```
527
-
528
- Switch over to the target branch and apply your changes:
529
-
530
- ```bash
531
- $ git checkout -b my_backport_branch 3-2-stable
532
- $ git apply ~/my_changes.patch
533
- ```
534
-
535
- This works well for simple changes. However, if your changes are complicated or if the code in master has deviated significantly from your target branch, it might require more work on your part. The difficulty of a backport varies greatly from case to case, and sometimes it is simply not worth the effort.
536
-
537
- Once you have resolved all conflicts and made sure all the tests are passing, push your changes and open a separate pull request for your backport. It is also worth noting that older branches might have a different set of build targets than master. When possible, it is best to first test your backport locally against the Ruby versions listed in `.travis.yml` before submitting your pull request.
538
-
539
- And then... think about your next contribution!
540
-
541
- Rails Contributors
542
- ------------------
543
-
544
- All contributions, either via master or docrails, get credit in [Rails Contributors](http://contributors.rubyonrails.org).