rails 4.1.14.2 → 4.2.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +12 -10
  3. data/guides/CHANGELOG.md +34 -37
  4. data/guides/Rakefile +21 -6
  5. data/guides/assets/images/getting_started/article_with_comments.png +0 -0
  6. data/guides/assets/javascripts/guides.js +6 -0
  7. data/guides/assets/stylesheets/main.css +4 -1
  8. data/guides/bug_report_templates/action_controller_gem.rb +1 -1
  9. data/guides/bug_report_templates/action_controller_master.rb +1 -0
  10. data/guides/bug_report_templates/active_record_gem.rb +1 -1
  11. data/guides/bug_report_templates/generic_gem.rb +1 -1
  12. data/guides/rails_guides/helpers.rb +1 -1
  13. data/guides/rails_guides/levenshtein.rb +27 -21
  14. data/guides/rails_guides/markdown/renderer.rb +1 -1
  15. data/guides/rails_guides/markdown.rb +11 -7
  16. data/guides/rails_guides.rb +2 -2
  17. data/guides/source/2_2_release_notes.md +1 -1
  18. data/guides/source/2_3_release_notes.md +4 -4
  19. data/guides/source/3_0_release_notes.md +8 -8
  20. data/guides/source/3_1_release_notes.md +5 -2
  21. data/guides/source/3_2_release_notes.md +6 -3
  22. data/guides/source/4_0_release_notes.md +6 -3
  23. data/guides/source/4_1_release_notes.md +5 -6
  24. data/guides/source/4_2_release_notes.md +877 -0
  25. data/guides/source/_license.html.erb +1 -1
  26. data/guides/source/_welcome.html.erb +6 -8
  27. data/guides/source/action_controller_overview.md +25 -8
  28. data/guides/source/action_mailer_basics.md +97 -29
  29. data/guides/source/action_view_overview.md +142 -183
  30. data/guides/source/active_job_basics.md +339 -0
  31. data/guides/source/active_model_basics.md +371 -17
  32. data/guides/source/active_record_basics.md +25 -24
  33. data/guides/source/active_record_callbacks.md +12 -9
  34. data/guides/source/{migrations.md → active_record_migrations.md} +95 -220
  35. data/guides/source/active_record_postgresql.md +433 -0
  36. data/guides/source/active_record_querying.md +264 -268
  37. data/guides/source/active_record_validations.md +23 -13
  38. data/guides/source/active_support_core_extensions.md +114 -75
  39. data/guides/source/active_support_instrumentation.md +10 -18
  40. data/guides/source/api_documentation_guidelines.md +63 -17
  41. data/guides/source/asset_pipeline.md +258 -119
  42. data/guides/source/association_basics.md +96 -80
  43. data/guides/source/autoloading_and_reloading_constants.md +1311 -0
  44. data/guides/source/caching_with_rails.md +32 -7
  45. data/guides/source/command_line.md +52 -30
  46. data/guides/source/configuring.md +161 -33
  47. data/guides/source/contributing_to_ruby_on_rails.md +198 -114
  48. data/guides/source/credits.html.erb +2 -2
  49. data/guides/source/debugging_rails_applications.md +440 -286
  50. data/guides/source/development_dependencies_install.md +47 -36
  51. data/guides/source/documents.yaml +19 -7
  52. data/guides/source/engines.md +189 -189
  53. data/guides/source/form_helpers.md +79 -56
  54. data/guides/source/generators.md +24 -11
  55. data/guides/source/getting_started.md +359 -219
  56. data/guides/source/i18n.md +110 -66
  57. data/guides/source/index.html.erb +1 -0
  58. data/guides/source/initialization.md +109 -62
  59. data/guides/source/layout.html.erb +5 -11
  60. data/guides/source/layouts_and_rendering.md +26 -26
  61. data/guides/source/maintenance_policy.md +6 -3
  62. data/guides/source/nested_model_forms.md +7 -4
  63. data/guides/source/plugins.md +27 -27
  64. data/guides/source/rails_application_templates.md +21 -3
  65. data/guides/source/rails_on_rack.md +8 -5
  66. data/guides/source/routing.md +113 -73
  67. data/guides/source/ruby_on_rails_guides_guidelines.md +11 -12
  68. data/guides/source/security.md +39 -33
  69. data/guides/source/testing.md +199 -119
  70. data/guides/source/upgrading_ruby_on_rails.md +287 -29
  71. data/guides/source/working_with_javascript_in_rails.md +19 -17
  72. data/guides/w3c_validator.rb +2 -0
  73. metadata +40 -95
  74. data/guides/code/getting_started/Gemfile +0 -40
  75. data/guides/code/getting_started/Gemfile.lock +0 -125
  76. data/guides/code/getting_started/README.rdoc +0 -28
  77. data/guides/code/getting_started/Rakefile +0 -6
  78. data/guides/code/getting_started/app/assets/javascripts/application.js +0 -15
  79. data/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +0 -3
  80. data/guides/code/getting_started/app/assets/javascripts/posts.js.coffee +0 -3
  81. data/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee +0 -3
  82. data/guides/code/getting_started/app/assets/stylesheets/application.css +0 -13
  83. data/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +0 -3
  84. data/guides/code/getting_started/app/assets/stylesheets/posts.css.scss +0 -3
  85. data/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss +0 -3
  86. data/guides/code/getting_started/app/controllers/application_controller.rb +0 -5
  87. data/guides/code/getting_started/app/controllers/comments_controller.rb +0 -23
  88. data/guides/code/getting_started/app/controllers/posts_controller.rb +0 -53
  89. data/guides/code/getting_started/app/controllers/welcome_controller.rb +0 -4
  90. data/guides/code/getting_started/app/helpers/application_helper.rb +0 -2
  91. data/guides/code/getting_started/app/helpers/comments_helper.rb +0 -2
  92. data/guides/code/getting_started/app/helpers/posts_helper.rb +0 -2
  93. data/guides/code/getting_started/app/helpers/welcome_helper.rb +0 -2
  94. data/guides/code/getting_started/app/models/comment.rb +0 -3
  95. data/guides/code/getting_started/app/models/post.rb +0 -7
  96. data/guides/code/getting_started/app/views/comments/_comment.html.erb +0 -15
  97. data/guides/code/getting_started/app/views/comments/_form.html.erb +0 -13
  98. data/guides/code/getting_started/app/views/layouts/application.html.erb +0 -14
  99. data/guides/code/getting_started/app/views/posts/_form.html.erb +0 -27
  100. data/guides/code/getting_started/app/views/posts/edit.html.erb +0 -5
  101. data/guides/code/getting_started/app/views/posts/index.html.erb +0 -21
  102. data/guides/code/getting_started/app/views/posts/new.html.erb +0 -5
  103. data/guides/code/getting_started/app/views/posts/show.html.erb +0 -18
  104. data/guides/code/getting_started/app/views/welcome/index.html.erb +0 -4
  105. data/guides/code/getting_started/bin/bundle +0 -4
  106. data/guides/code/getting_started/bin/rails +0 -4
  107. data/guides/code/getting_started/bin/rake +0 -4
  108. data/guides/code/getting_started/config/application.rb +0 -18
  109. data/guides/code/getting_started/config/boot.rb +0 -4
  110. data/guides/code/getting_started/config/database.yml +0 -25
  111. data/guides/code/getting_started/config/environment.rb +0 -5
  112. data/guides/code/getting_started/config/environments/development.rb +0 -30
  113. data/guides/code/getting_started/config/environments/production.rb +0 -80
  114. data/guides/code/getting_started/config/environments/test.rb +0 -36
  115. data/guides/code/getting_started/config/initializers/backtrace_silencers.rb +0 -7
  116. data/guides/code/getting_started/config/initializers/filter_parameter_logging.rb +0 -4
  117. data/guides/code/getting_started/config/initializers/inflections.rb +0 -16
  118. data/guides/code/getting_started/config/initializers/locale.rb +0 -9
  119. data/guides/code/getting_started/config/initializers/mime_types.rb +0 -5
  120. data/guides/code/getting_started/config/initializers/secret_token.rb +0 -12
  121. data/guides/code/getting_started/config/initializers/session_store.rb +0 -3
  122. data/guides/code/getting_started/config/initializers/wrap_parameters.rb +0 -14
  123. data/guides/code/getting_started/config/locales/en.yml +0 -23
  124. data/guides/code/getting_started/config/routes.rb +0 -7
  125. data/guides/code/getting_started/config.ru +0 -4
  126. data/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb +0 -10
  127. data/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb +0 -11
  128. data/guides/code/getting_started/db/schema.rb +0 -33
  129. data/guides/code/getting_started/db/seeds.rb +0 -7
  130. data/guides/code/getting_started/public/404.html +0 -60
  131. data/guides/code/getting_started/public/422.html +0 -60
  132. data/guides/code/getting_started/public/500.html +0 -59
  133. data/guides/code/getting_started/public/favicon.ico +0 -0
  134. data/guides/code/getting_started/public/robots.txt +0 -5
  135. data/guides/code/getting_started/test/controllers/comments_controller_test.rb +0 -7
  136. data/guides/code/getting_started/test/controllers/posts_controller_test.rb +0 -7
  137. data/guides/code/getting_started/test/controllers/welcome_controller_test.rb +0 -9
  138. data/guides/code/getting_started/test/fixtures/comments.yml +0 -11
  139. data/guides/code/getting_started/test/fixtures/posts.yml +0 -9
  140. data/guides/code/getting_started/test/helpers/comments_helper_test.rb +0 -4
  141. data/guides/code/getting_started/test/helpers/posts_helper_test.rb +0 -4
  142. data/guides/code/getting_started/test/helpers/welcome_helper_test.rb +0 -4
  143. data/guides/code/getting_started/test/models/comment_test.rb +0 -7
  144. data/guides/code/getting_started/test/models/post_test.rb +0 -7
  145. data/guides/code/getting_started/test/test_helper.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8ffcecb97e36f6386704abb18bd525cde3be435c
4
- data.tar.gz: 764b08ce11791e6c3d26ee37c896b0d178169c2d
2
+ SHA256:
3
+ metadata.gz: 4102988547e646fdb3241e16210ae1facf8e3d894c36e2b1deff16131fc41e35
4
+ data.tar.gz: 15db282a7d3be7e7384a7c5adbea7f1e15c7f2ebc08e52dbcb98ebf68a9187ee
5
5
  SHA512:
6
- metadata.gz: 8c56b9a415ec15c05a712aa6c9b1d83844e39780cda0e11ea2bff91a55e7c552bd014d80b44bc56b4393465485aa762d37c849472d83676f2f97766d0970a0db
7
- data.tar.gz: 204cc4b7817d6b00ac746de9920d3b098c2da8ea6c25908c2a92909d48b48c37ed1443c70eb2fbabaadf2b430387fadd6df501345ccafb181fed5645fae07a07
6
+ metadata.gz: '03397d1bec513121e4b39de380eda105ca1a040c13cdede32a46b49fcc1c69a18b274429bec9ebd017513fa14f83b1bd9c4ff092baa7deb3874f6b779aec37f9'
7
+ data.tar.gz: bce9f9aec430af1a231ca61323b8893022c04a225a24b0564750c8387b67bdfc542892dde397bb641d0ee4e4ef6c9620b5e7af92e063f2e81463bbd7fd8401a8
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Rails is a web-application framework that includes everything needed to
4
4
  create database-backed web applications according to the
5
- [Model-View-Controller (MVC)](http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller)
5
+ [Model-View-Controller (MVC)](http://en.wikipedia.org/wiki/Model-view-controller)
6
6
  pattern.
7
7
 
8
8
  Understanding the MVC pattern is key to understanding Rails. MVC divides your
@@ -13,10 +13,10 @@ Person, Post, etc.) and encapsulates the business logic that is specific to
13
13
  your application. In Rails, database-backed model classes are derived from
14
14
  `ActiveRecord::Base`. Active Record allows you to present the data from
15
15
  database rows as objects and embellish these data objects with business logic
16
- methods. Although most Rails models are backed by a database, models can also
17
- be ordinary Ruby classes, or Ruby classes that implement a set of interfaces
18
- as provided by the Active Model module. You can read more about Active Record
19
- in its [README](activerecord/README.rdoc).
16
+ methods. You can read more about Active Record in its [README](activerecord/README.rdoc).
17
+ Although most Rails models are backed by a database, models can also be ordinary
18
+ Ruby classes, or Ruby classes that implement a set of interfaces as provided by
19
+ the Active Model module. You can read more about Active Model in its [README](activemodel/README.rdoc).
20
20
 
21
21
  The _Controller layer_ is responsible for handling incoming HTTP requests and
22
22
  providing a suitable response. Usually this means returning HTML, but Rails controllers
@@ -36,9 +36,11 @@ You can read more about Action View in its [README](actionview/README.rdoc).
36
36
 
37
37
  Active Record, Action Pack, and Action View can each be used independently outside Rails.
38
38
  In addition to them, Rails also comes with Action Mailer ([README](actionmailer/README.rdoc)), a library
39
- to generate and send emails; and Active Support ([README](activesupport/README.rdoc)), a collection of
40
- utility classes and standard library extensions that are useful for Rails, and may also be used
41
- independently outside Rails.
39
+ to generate and send emails; Active Job ([README](activejob/README.md)), a
40
+ framework for declaring jobs and making them run on a variety of queueing
41
+ backends; and Active Support ([README](activesupport/README.rdoc)), a collection
42
+ of utility classes and standard library extensions that are useful for Rails,
43
+ and may also be used independently outside Rails.
42
44
 
43
45
  ## Getting Started
44
46
 
@@ -67,7 +69,7 @@ independently outside Rails.
67
69
  * [Getting Started with Rails](http://guides.rubyonrails.org/getting_started.html)
68
70
  * [Ruby on Rails Guides](http://guides.rubyonrails.org)
69
71
  * [The API Documentation](http://api.rubyonrails.org)
70
- * [Ruby on Rails Tutorial](http://ruby.railstutorial.org/ruby-on-rails-tutorial-book)
72
+ * [Ruby on Rails Tutorial](http://www.railstutorial.org/book)
71
73
 
72
74
  ## Contributing
73
75
 
@@ -76,7 +78,7 @@ We encourage you to contribute to Ruby on Rails! Please check out the
76
78
 
77
79
  ## Code Status
78
80
 
79
- * [![Build Status](https://travis-ci.org/rails/rails.png?branch=master)](https://travis-ci.org/rails/rails)
81
+ * [![Build Status](https://travis-ci.org/rails/rails.svg?branch=4-2-stable)](https://travis-ci.org/rails/rails)
80
82
 
81
83
  ## License
82
84
 
data/guides/CHANGELOG.md CHANGED
@@ -1,106 +1,103 @@
1
- ## Rails 4.1.14.2 (February 26, 2016) ##
1
+ ## Rails 4.2.11.1 (March 11, 2019) ##
2
2
 
3
3
  * No changes.
4
4
 
5
5
 
6
- ## Rails 4.1.14.1 (January 25, 2015) ##
6
+ ## Rails 4.2.11 (November 27, 2018) ##
7
7
 
8
8
  * No changes.
9
9
 
10
10
 
11
- ## Rails 4.1.14 (November 12, 2015) ##
11
+ ## Rails 4.2.10 (September 27, 2017) ##
12
12
 
13
13
  * No changes.
14
14
 
15
15
 
16
- ## Rails 4.1.13 (August 24, 2015) ##
16
+ ## Rails 4.2.9 (June 26, 2017) ##
17
17
 
18
18
  * No changes.
19
19
 
20
20
 
21
- ## Rails 4.1.12 (June 25, 2015) ##
21
+ ## Rails 4.2.8 (February 21, 2017) ##
22
22
 
23
23
  * No changes.
24
24
 
25
25
 
26
- ## Rails 4.1.11 (June 16, 2015) ##
26
+ ## Rails 4.2.7 (July 12, 2016) ##
27
27
 
28
28
  * No changes.
29
29
 
30
30
 
31
- ## Rails 4.1.10 (March 19, 2015) ##
31
+ ## Rails 4.2.6 (March 07, 2016) ##
32
32
 
33
33
  * No changes.
34
34
 
35
35
 
36
- ## Rails 4.1.9 (January 6, 2015) ##
36
+ ## Rails 4.2.5.2 (February 26, 2016) ##
37
37
 
38
38
  * No changes.
39
39
 
40
40
 
41
- ## Rails 4.1.8 (November 16, 2014) ##
41
+ ## Rails 4.2.5.1 (January 25, 2016) ##
42
42
 
43
43
  * No changes.
44
44
 
45
45
 
46
- ## Rails 4.1.7.1 (November 19, 2014) ##
46
+ ## Rails 4.2.5 (November 12, 2015) ##
47
47
 
48
48
  * No changes.
49
49
 
50
50
 
51
- ## Rails 4.1.7 (October 29, 2014) ##
51
+ ## Rails 4.2.4 (August 24, 2015) ##
52
52
 
53
- * No changes.
53
+ * No Changes *
54
54
 
55
55
 
56
- ## Rails 4.1.6 (September 11, 2014) ##
56
+ ## Rails 4.2.3 (June 25, 2015) ##
57
57
 
58
- * No changes.
58
+ * No Changes *
59
59
 
60
60
 
61
- ## Rails 4.1.5 (August 18, 2014) ##
61
+ ## Rails 4.2.2 (June 16, 2015) ##
62
62
 
63
- * No changes.
63
+ * No Changes *
64
64
 
65
65
 
66
- ## Rails 4.1.4 (July 2, 2014) ##
66
+ ## Rails 4.2.1 (March 19, 2015) ##
67
67
 
68
68
  * No changes.
69
69
 
70
70
 
71
- ## Rails 4.1.3 (July 2, 2014) ##
71
+ ## Rails 4.2.0 (December 20, 2014) ##
72
72
 
73
- * No changes.
73
+ * New guide about constant autoloading and reloading.
74
74
 
75
+ *Xavier Noria*
75
76
 
76
- ## Rails 4.1.2 (June 26, 2014) ##
77
-
78
- * Update all Rails 4.1.0 references to 4.1.1 within the guides and code.
77
+ * Change Posts to Articles in Getting Started sample application in order to
78
+ better align with the actual guides.
79
79
 
80
80
  *John Kelly Ferguson*
81
81
 
82
- * Updates the maintenance policy to match the latest versions of Rails.
83
-
84
- *Matias Korhonen*
85
-
86
-
87
- ## Rails 4.1.1 (May 6, 2014) ##
82
+ * Update all Rails 4.1.0 references to 4.1.1 within the guides and code.
88
83
 
89
- * No changes.
84
+ *John Kelly Ferguson*
90
85
 
86
+ * Split up rows in the Explain Queries table of the ActiveRecord Querying section
87
+ in order to improve readability.
91
88
 
92
- ## Rails 4.1.0 (April 8, 2014) ##
89
+ *John Kelly Ferguson*
93
90
 
94
- * Fixed missing line and shadow on service pages(404, 422, 500).
91
+ * Change all non-HTTP method 'post' references to 'article'.
95
92
 
96
- *Dmitry Korotkov*
93
+ *John Kelly Ferguson*
97
94
 
98
- * Removed repetitive th tags. Instead of them added one th tag with a colspan attribute.
95
+ * Updates the maintenance policy to match the latest versions of Rails
99
96
 
100
- *Sıtkı Bağdat*
97
+ *Matias Korhonen*
101
98
 
102
- * Added the Rails maintenance policy to the guides.
99
+ * Switched the order of `Applying a default scope` and `Merging of scopes` subsections so default scopes are introduced first.
103
100
 
104
- *Matias Korhonen*
101
+ *Alex Riabov*
105
102
 
106
- Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/guides/CHANGELOG.md) for previous changes.
103
+ Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/guides/CHANGELOG.md) for previous changes.
data/guides/Rakefile CHANGED
@@ -3,18 +3,31 @@ namespace :guides do
3
3
  desc 'Generate guides (for authors), use ONLY=foo to process just "foo.md"'
4
4
  task :generate => 'generate:html'
5
5
 
6
+ # Guides are written in UTF-8, but the environment may be configured for some
7
+ # other locale, these tasks are responsible for ensuring the default external
8
+ # encoding is UTF-8.
9
+ #
10
+ # Real use cases: Generation was reported to fail on a machine configured with
11
+ # GBK (Chinese). The docs server once got misconfigured somehow and had "C",
12
+ # which broke generation too.
13
+ task :encoding do
14
+ %w(LANG LANGUAGE LC_ALL).each do |env_var|
15
+ ENV[env_var] = "en_US.UTF-8"
16
+ end
17
+ end
18
+
6
19
  namespace :generate do
7
20
 
8
21
  desc "Generate HTML guides"
9
- task :html do
22
+ task :html => :encoding do
10
23
  ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
11
24
  ruby "rails_guides.rb"
12
25
  end
13
26
 
14
27
  desc "Generate .mobi file. The kindlegen executable must be in your PATH. You can get it for free from http://www.amazon.com/kindlepublishing"
15
- task :kindle do
16
- unless `kindlerb -v 2> /dev/null` =~ /kindlerb 0.1.1/
17
- abort "Please `gem install kindlerb`"
28
+ task :kindle => :encoding do
29
+ unless `kindlerb -v 2> /dev/null` =~ /kindlerb 0.1.1/
30
+ abort "Please `gem install kindlerb` and make sure you have `kindlegen` in your PATH"
18
31
  end
19
32
  unless `convert` =~ /convert/
20
33
  abort "Please install ImageMagick`"
@@ -26,7 +39,7 @@ namespace :guides do
26
39
 
27
40
  # Validate guides -------------------------------------------------------------------------
28
41
  desc 'Validate guides, use ONLY=foo to process just "foo.html"'
29
- task :validate do
42
+ task :validate => :encoding do
30
43
  ruby "w3c_validator.rb"
31
44
  end
32
45
 
@@ -34,10 +47,12 @@ namespace :guides do
34
47
  task :help do
35
48
  puts <<-help
36
49
 
37
- Guides are taken from the source directory, and the resulting HTML goes into the
50
+ Guides are taken from the source directory, and the result goes into the
38
51
  output directory. Assets are stored under files, and copied to output/files as
39
52
  part of the generation process.
40
53
 
54
+ You can generate HTML, Kindle or both formats using the `guides:generate` task.
55
+
41
56
  All this process is handled via rake tasks, here's a full list of them:
42
57
 
43
58
  #{%x[rake -T]}
@@ -51,3 +51,9 @@ var guidesIndex = {
51
51
  window.location = url;
52
52
  }
53
53
  };
54
+
55
+ // Disable autolink inside example code blocks of guides.
56
+ $(document).ready(function() {
57
+ SyntaxHighlighter.defaults['auto-links'] = false;
58
+ SyntaxHighlighter.all();
59
+ });
@@ -381,9 +381,12 @@ a, a:link, a:visited {
381
381
  font: inherit;
382
382
  padding-left: .75em;
383
383
  font-size: .95em;
384
- background-position: 96% -65px;
384
+ background-position: 96% 16px;
385
385
  -webkit-appearance: none;
386
386
  }
387
+ .guides-index-small .guides-index-item:hover{
388
+ background-position: 96% -65px;
389
+ }
387
390
  }
388
391
 
389
392
  #guides {
@@ -1,5 +1,5 @@
1
1
  # Activate the gem you are reporting the issue against.
2
- gem 'rails', '4.0.0'
2
+ gem 'rails', '4.2.0'
3
3
 
4
4
  require 'rails'
5
5
  require 'action_controller/railtie'
@@ -2,6 +2,7 @@ unless File.exist?('Gemfile')
2
2
  File.write('Gemfile', <<-GEMFILE)
3
3
  source 'https://rubygems.org'
4
4
  gem 'rails', github: 'rails/rails'
5
+ gem 'arel', github: 'rails/arel'
5
6
  GEMFILE
6
7
 
7
8
  system 'bundle'
@@ -1,5 +1,5 @@
1
1
  # Activate the gem you are reporting the issue against.
2
- gem 'activerecord', '4.0.0'
2
+ gem 'activerecord', '4.2.0'
3
3
  require 'active_record'
4
4
  require 'minitest/autorun'
5
5
  require 'logger'
@@ -1,5 +1,5 @@
1
1
  # Activate the gems you are reporting the issue against.
2
- gem 'activesupport', '4.0.0'
2
+ gem 'activesupport', '4.2.0'
3
3
  require 'active_support'
4
4
  require 'active_support/core_ext/object/blank'
5
5
  require 'minitest/autorun'
@@ -39,7 +39,7 @@ module RailsGuides
39
39
  def author(name, nick, image = 'credits_pic_blank.gif', &block)
40
40
  image = "images/#{image}"
41
41
 
42
- result = content_tag(:img, nil, :src => image, :class => 'left pic', :alt => name, :width => 91, :height => 91)
42
+ result = tag(:img, :src => image, :class => 'left pic', :alt => name, :width => 91, :height => 91)
43
43
  result << content_tag(:h3, name)
44
44
  result << content_tag(:p, capture(&block))
45
45
  content_tag(:div, result, :class => 'clearfix', :id => nick)
@@ -1,31 +1,37 @@
1
1
  module RailsGuides
2
2
  module Levenshtein
3
- # Based on the pseudocode in http://en.wikipedia.org/wiki/Levenshtein_distance
4
- def self.distance(s1, s2)
5
- s = s1.unpack('U*')
6
- t = s2.unpack('U*')
7
- m = s.length
8
- n = t.length
3
+ # This code is based directly on the Text gem implementation
4
+ # Returns a value representing the "cost" of transforming str1 into str2
5
+ def self.distance str1, str2
6
+ s = str1
7
+ t = str2
8
+ n = s.length
9
+ m = t.length
9
10
 
10
- # matrix initialization
11
- d = []
12
- 0.upto(m) { |i| d << [i] }
13
- 0.upto(n) { |j| d[0][j] = j }
11
+ return m if (0 == n)
12
+ return n if (0 == m)
14
13
 
15
- # distance computation
16
- 1.upto(m) do |i|
17
- 1.upto(n) do |j|
18
- cost = s[i] == t[j] ? 0 : 1
19
- d[i][j] = [
20
- d[i-1][j] + 1, # deletion
21
- d[i][j-1] + 1, # insertion
22
- d[i-1][j-1] + cost, # substitution
23
- ].min
14
+ d = (0..m).to_a
15
+ x = nil
16
+
17
+ str1.each_char.each_with_index do |char1,i|
18
+ e = i+1
19
+
20
+ str2.each_char.each_with_index do |char2,j|
21
+ cost = (char1 == char2) ? 0 : 1
22
+ x = [
23
+ d[j+1] + 1, # insertion
24
+ e + 1, # deletion
25
+ d[j] + cost # substitution
26
+ ].min
27
+ d[j] = e
28
+ e = x
24
29
  end
30
+
31
+ d[m] = x
25
32
  end
26
33
 
27
- # all done
28
- return d[m][n]
34
+ return x
29
35
  end
30
36
  end
31
37
  end
@@ -50,7 +50,7 @@ HTML
50
50
  when 'erb'
51
51
  'ruby; html-script: true'
52
52
  when 'html'
53
- 'xml' # html is understood, but there are .xml rules in the CSS
53
+ 'xml' # HTML is understood, but there are .xml rules in the CSS
54
54
  else
55
55
  'plain'
56
56
  end
@@ -47,8 +47,12 @@ module RailsGuides
47
47
  end
48
48
 
49
49
  def dom_id_text(text)
50
- text.downcase.gsub(/\?/, '-questionmark').gsub(/!/, '-bang').gsub(/[^a-z0-9]+/, ' ')
51
- .strip.gsub(/\s+/, '-')
50
+ escaped_chars = Regexp.escape('\\/`*_{}[]()#+-.!:,;|&<>^~=\'"')
51
+
52
+ text.downcase.gsub(/\?/, '-questionmark')
53
+ .gsub(/!/, '-bang')
54
+ .gsub(/[#{escaped_chars}]+/, ' ').strip
55
+ .gsub(/\s+/, '-')
52
56
  end
53
57
 
54
58
  def engine
@@ -79,10 +83,10 @@ module RailsGuides
79
83
  def generate_structure
80
84
  @headings_for_index = []
81
85
  if @body.present?
82
- @body = Nokogiri::HTML(@body).tap do |doc|
86
+ @body = Nokogiri::HTML.fragment(@body).tap do |doc|
83
87
  hierarchy = []
84
88
 
85
- doc.at('body').children.each do |node|
89
+ doc.children.each do |node|
86
90
  if node.name =~ /^h[3-6]$/
87
91
  case node.name
88
92
  when 'h3'
@@ -116,7 +120,7 @@ module RailsGuides
116
120
  end
117
121
  end
118
122
 
119
- @index = Nokogiri::HTML(engine.render(raw_index)).tap do |doc|
123
+ @index = Nokogiri::HTML.fragment(engine.render(raw_index)).tap do |doc|
120
124
  doc.at('ol')[:class] = 'chapters'
121
125
  end.to_html
122
126
 
@@ -130,8 +134,8 @@ module RailsGuides
130
134
  end
131
135
 
132
136
  def generate_title
133
- if heading = Nokogiri::HTML(@header).at(:h2)
134
- @title = "#{heading.text} — Ruby on Rails Guides".html_safe
137
+ if heading = Nokogiri::HTML.fragment(@header).at(:h2)
138
+ @title = "#{heading.text} — Ruby on Rails Guides"
135
139
  else
136
140
  @title = "Ruby on Rails Guides"
137
141
  end
@@ -24,11 +24,11 @@ begin
24
24
  require 'redcarpet'
25
25
  rescue LoadError
26
26
  # This can happen if doc:guides is executed in an application.
27
- $stderr.puts('Generating guides requires Redcarpet 2.1.1+.')
27
+ $stderr.puts('Generating guides requires Redcarpet 3.1.2+.')
28
28
  $stderr.puts(<<ERROR) if bundler?
29
29
  Please add
30
30
 
31
- gem 'redcarpet', '~> 2.1.1'
31
+ gem 'redcarpet', '~> 3.1.2'
32
32
 
33
33
  to the Gemfile, run
34
34
 
@@ -1,7 +1,7 @@
1
1
  Ruby on Rails 2.2 Release Notes
2
2
  ===============================
3
3
 
4
- Rails 2.2 delivers a number of new and improved features. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/master) in the main Rails repository on GitHub.
4
+ Rails 2.2 delivers a number of new and improved features. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/2-2-stable) in the main Rails repository on GitHub.
5
5
 
6
6
  Along with Rails, 2.2 marks the launch of the [Ruby on Rails Guides](http://guides.rubyonrails.org/), the first results of the ongoing [Rails Guides hackfest](http://hackfest.rubyonrails.org/guide). This site will deliver high-quality documentation of the major features of Rails.
7
7
 
@@ -1,14 +1,14 @@
1
1
  Ruby on Rails 2.3 Release Notes
2
2
  ===============================
3
3
 
4
- Rails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering, more efficient routing, application templates, and quiet backtraces. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/master) in the main Rails repository on GitHub or review the `CHANGELOG` files for the individual Rails components.
4
+ Rails 2.3 delivers a variety of new and improved features, including pervasive Rack integration, refreshed support for Rails Engines, nested transactions for Active Record, dynamic and default scopes, unified rendering, more efficient routing, application templates, and quiet backtraces. This list covers the major upgrades, but doesn't include every little bug fix and change. If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/2-3-stable) in the main Rails repository on GitHub or review the `CHANGELOG` files for the individual Rails components.
5
5
 
6
6
  --------------------------------------------------------------------------------
7
7
 
8
8
  Application Architecture
9
9
  ------------------------
10
10
 
11
- There are two major changes in the architecture of Rails applications: complete integration of the [Rack](http://rack.rubyforge.org/) modular web server interface, and renewed support for Rails Engines.
11
+ There are two major changes in the architecture of Rails applications: complete integration of the [Rack](http://rack.github.io/) modular web server interface, and renewed support for Rails Engines.
12
12
 
13
13
  ### Rack Integration
14
14
 
@@ -594,7 +594,7 @@ The internals of the various <code>rake gem</code> tasks have been substantially
594
594
  * Various files in /public that deal with CGI and FCGI dispatching are no longer generated in every Rails application by default (you can still get them if you need them by adding `--with-dispatchers` when you run the `rails` command, or add them later with `rake rails:update:generate_dispatchers`).
595
595
  * Rails Guides have been converted from AsciiDoc to Textile markup.
596
596
  * Scaffolded views and controllers have been cleaned up a bit.
597
- * `script/server` now accepts a <tt>--path</tt> argument to mount a Rails application from a specific path.
597
+ * `script/server` now accepts a `--path` argument to mount a Rails application from a specific path.
598
598
  * If any configured gems are missing, the gem rake tasks will skip loading much of the environment. This should solve many of the "chicken-and-egg" problems where rake gems:install couldn't run because gems were missing.
599
599
  * Gems are now unpacked exactly once. This fixes issues with gems (hoe, for instance) which are packed with read-only permissions on the files.
600
600
 
@@ -618,4 +618,4 @@ A few pieces of older code are deprecated in this release:
618
618
  Credits
619
619
  -------
620
620
 
621
- Release notes compiled by [Mike Gunderloy](http://afreshcup.com.) This version of the Rails 2.3 release notes was compiled based on RC2 of Rails 2.3.
621
+ Release notes compiled by [Mike Gunderloy](http://afreshcup.com). This version of the Rails 2.3 release notes was compiled based on RC2 of Rails 2.3.
@@ -15,7 +15,7 @@ Even if you don't give a hoot about any of our internal cleanups, Rails 3.0 is g
15
15
 
16
16
  On top of all that, we've tried our best to deprecate the old APIs with nice warnings. That means that you can move your existing application to Rails 3 without immediately rewriting all your old code to the latest best practices.
17
17
 
18
- These release notes cover the major upgrades, but don't include every little bug fix and change. Rails 3.0 consists of almost 4,000 commits by more than 250 authors! If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/master) in the main Rails repository on GitHub.
18
+ These release notes cover the major upgrades, but don't include every little bug fix and change. Rails 3.0 consists of almost 4,000 commits by more than 250 authors! If you want to see everything, check out the [list of commits](http://github.com/rails/rails/commits/3-0-stable) in the main Rails repository on GitHub.
19
19
 
20
20
  --------------------------------------------------------------------------------
21
21
 
@@ -138,7 +138,7 @@ More Information: - [Rails Edge Architecture](http://yehudakatz.com/2009/06/11/r
138
138
 
139
139
  [Arel](http://github.com/brynary/arel) (or Active Relation) has been taken on as the underpinnings of Active Record and is now required for Rails. Arel provides an SQL abstraction that simplifies out Active Record and provides the underpinnings for the relation functionality in Active Record.
140
140
 
141
- More information: - [Why I wrote Arel](http://magicscalingsprinkles.wordpress.com/2010/01/28/why-i-wrote-arel/.)
141
+ More information: - [Why I wrote Arel](https://web.archive.org/web/20120718093140/http://magicscalingsprinkles.wordpress.com/2010/01/28/why-i-wrote-arel/)
142
142
 
143
143
 
144
144
  ### Mail Extraction
@@ -294,11 +294,11 @@ NOTE. The old style `map` commands still work as before with a backwards compati
294
294
  Deprecations
295
295
 
296
296
  * The catch all route for non-REST applications (`/:controller/:action/:id`) is now commented out.
297
- * Routes :path\_prefix no longer exists and :name\_prefix now automatically adds "\_" at the end of the given value.
297
+ * Routes `:path_prefix` no longer exists and `:name_prefix` now automatically adds "_" at the end of the given value.
298
298
 
299
299
  More Information:
300
300
  * [The Rails 3 Router: Rack it Up](http://yehudakatz.com/2009/12/26/the-rails-3-router-rack-it-up/)
301
- * [Revamped Routes in Rails 3](http://rizwanreza.com/2009/12/20/revamped-routes-in-rails-3)
301
+ * [Revamped Routes in Rails 3](https://medium.com/fusion-of-thoughts/revamped-routes-in-rails-3-b6d00654e5b0)
302
302
  * [Generic Actions in Rails 3](http://yehudakatz.com/2009/12/20/generic-actions-in-rails-3/)
303
303
 
304
304
 
@@ -308,7 +308,7 @@ More Information:
308
308
 
309
309
  Major re-write was done in the Action View helpers, implementing Unobtrusive JavaScript (UJS) hooks and removing the old inline AJAX commands. This enables Rails to use any compliant UJS driver to implement the UJS hooks in the helpers.
310
310
 
311
- What this means is that all previous `remote_<method>` helpers have been removed from Rails core and put into the [Prototype Legacy Helper](http://github.com/rails/prototype_legacy_helper.) To get UJS hooks into your HTML, you now pass `:remote => true` instead. For example:
311
+ What this means is that all previous `remote_<method>` helpers have been removed from Rails core and put into the [Prototype Legacy Helper](http://github.com/rails/prototype_legacy_helper). To get UJS hooks into your HTML, you now pass `:remote => true` instead. For example:
312
312
 
313
313
  ```ruby
314
314
  form_for @post, :remote => true
@@ -521,7 +521,7 @@ A large effort was made in Active Support to make it cherry pickable, that is, y
521
521
  These are the main changes in Active Support:
522
522
 
523
523
  * Large clean up of the library removing unused methods throughout.
524
- * Active Support no longer provides vendored versions of [TZInfo](http://tzinfo.rubyforge.org/), [Memcache Client](http://deveiate.org/projects/RMemCache/) and [Builder](http://builder.rubyforge.org/,) these are all included as dependencies and installed via the `bundle install` command.
524
+ * Active Support no longer provides vendored versions of TZInfo, Memcache Client and Builder. These are all included as dependencies and installed via the `bundle install` command.
525
525
  * Safe buffers are implemented in `ActiveSupport::SafeBuffer`.
526
526
  * Added `Array.uniq_by` and `Array.uniq_by!`.
527
527
  * Removed `Array#rand` and backported `Array#sample` from Ruby 1.9.
@@ -545,7 +545,7 @@ These are the main changes in Active Support:
545
545
  * `String#to_time` and `String#to_datetime` handle fractional seconds.
546
546
  * Added support to new callbacks for around filter object that respond to `:before` and `:after` used in before and after callbacks.
547
547
  * The `ActiveSupport::OrderedHash#to_a` method returns an ordered set of arrays. Matches Ruby 1.9's `Hash#to_a`.
548
- * `MissingSourceFile` exists as a constant but it is now just equals to `LoadError`.
548
+ * `MissingSourceFile` exists as a constant but it is now just equal to `LoadError`.
549
549
  * Added `Class#class_attribute`, to be able to declare a class-level attribute whose value is inheritable and overwritable by subclasses.
550
550
  * Finally removed `DeprecatedCallbacks` in `ActiveRecord::Associations`.
551
551
  * `Object#metaclass` is now `Kernel#singleton_class` to match Ruby.
@@ -608,4 +608,4 @@ Credits
608
608
 
609
609
  See the [full list of contributors to Rails](http://contributors.rubyonrails.org/) for the many people who spent many hours making Rails 3. Kudos to all of them.
610
610
 
611
- Rails 3.0 Release Notes were compiled by [Mikel Lindsaar](http://lindsaar.net.)
611
+ Rails 3.0 Release Notes were compiled by [Mikel Lindsaar](http://lindsaar.net).
@@ -8,7 +8,10 @@ Highlights in Rails 3.1:
8
8
  * Assets Pipeline
9
9
  * jQuery as the default JavaScript library
10
10
 
11
- This release notes cover the major changes, but don't include every little bug fix and change. If you want to see everything, check out the [list of commits](https://github.com/rails/rails/commits/master) in the main Rails repository on GitHub.
11
+ These release notes cover only the major changes. To learn about various bug
12
+ fixes and changes, please refer to the change logs or check out the [list of
13
+ commits](https://github.com/rails/rails/commits/3-1-stable) in the main Rails
14
+ repository on GitHub.
12
15
 
13
16
  --------------------------------------------------------------------------------
14
17
 
@@ -173,7 +176,7 @@ The assets pipeline is powered by [Sprockets](https://github.com/rails/sprockets
173
176
 
174
177
  ### HTTP Streaming
175
178
 
176
- HTTP Streaming is another change that is new in Rails 3.1. This lets the browser download your stylesheets and JavaScript files while the server is still generating the response. This requires Ruby 1.9.2, is opt-in and requires support from the web server as well, but the popular combo of nginx and unicorn is ready to take advantage of it.
179
+ HTTP Streaming is another change that is new in Rails 3.1. This lets the browser download your stylesheets and JavaScript files while the server is still generating the response. This requires Ruby 1.9.2, is opt-in and requires support from the web server as well, but the popular combo of NGINX and Unicorn is ready to take advantage of it.
177
180
 
178
181
  ### Default JS library is now jQuery
179
182
 
@@ -8,7 +8,10 @@ Highlights in Rails 3.2:
8
8
  * Automatic Query Explains
9
9
  * Tagged Logging
10
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.
11
+ These release notes cover only the major changes. To learn about various bug
12
+ fixes and changes, please refer to the change logs or check out the [list of
13
+ commits](https://github.com/rails/rails/commits/3-2-stable) in the main Rails
14
+ repository on GitHub.
12
15
 
13
16
  --------------------------------------------------------------------------------
14
17
 
@@ -187,7 +190,7 @@ Action Pack
187
190
 
188
191
  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
192
 
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}`.
193
+ * `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
194
 
192
195
  * `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
196
 
@@ -562,4 +565,4 @@ Credits
562
565
 
563
566
  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
567
 
565
- Rails 3.2 Release Notes were compiled by [Vijay Dev](https://github.com/vijaydev.)
568
+ Rails 3.2 Release Notes were compiled by [Vijay Dev](https://github.com/vijaydev).