rails 4.1.4 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -10
  3. data/guides/CHANGELOG.md +15 -25
  4. data/guides/Rakefile +5 -3
  5. data/guides/assets/javascripts/guides.js +6 -0
  6. data/guides/assets/stylesheets/main.css +4 -1
  7. data/guides/bug_report_templates/action_controller_gem.rb +2 -2
  8. data/guides/bug_report_templates/action_controller_master.rb +3 -2
  9. data/guides/rails_guides/helpers.rb +1 -1
  10. data/guides/rails_guides/levenshtein.rb +29 -21
  11. data/guides/rails_guides/markdown/renderer.rb +1 -1
  12. data/guides/rails_guides/markdown.rb +11 -7
  13. data/guides/rails_guides.rb +2 -2
  14. data/guides/source/2_2_release_notes.md +1 -1
  15. data/guides/source/2_3_release_notes.md +4 -4
  16. data/guides/source/3_0_release_notes.md +8 -8
  17. data/guides/source/3_1_release_notes.md +5 -2
  18. data/guides/source/3_2_release_notes.md +6 -3
  19. data/guides/source/4_0_release_notes.md +6 -3
  20. data/guides/source/4_1_release_notes.md +10 -11
  21. data/guides/source/4_2_release_notes.md +850 -0
  22. data/guides/source/_license.html.erb +1 -1
  23. data/guides/source/_welcome.html.erb +2 -8
  24. data/guides/source/action_controller_overview.md +84 -10
  25. data/guides/source/action_mailer_basics.md +91 -28
  26. data/guides/source/action_view_overview.md +140 -130
  27. data/guides/source/active_job_basics.md +318 -0
  28. data/guides/source/active_model_basics.md +371 -17
  29. data/guides/source/active_record_basics.md +19 -18
  30. data/guides/source/active_record_callbacks.md +12 -9
  31. data/guides/source/{migrations.md → active_record_migrations.md} +135 -226
  32. data/guides/source/active_record_postgresql.md +433 -0
  33. data/guides/source/active_record_querying.md +269 -259
  34. data/guides/source/active_record_validations.md +21 -12
  35. data/guides/source/active_support_core_extensions.md +113 -73
  36. data/guides/source/active_support_instrumentation.md +10 -7
  37. data/guides/source/api_documentation_guidelines.md +62 -16
  38. data/guides/source/asset_pipeline.md +264 -67
  39. data/guides/source/association_basics.md +81 -74
  40. data/guides/source/caching_with_rails.md +32 -7
  41. data/guides/source/command_line.md +52 -30
  42. data/guides/source/configuring.md +132 -29
  43. data/guides/source/constant_autoloading_and_reloading.md +1297 -0
  44. data/guides/source/contributing_to_ruby_on_rails.md +192 -112
  45. data/guides/source/credits.html.erb +2 -2
  46. data/guides/source/debugging_rails_applications.md +448 -294
  47. data/guides/source/development_dependencies_install.md +47 -36
  48. data/guides/source/documents.yaml +19 -7
  49. data/guides/source/engines.md +210 -189
  50. data/guides/source/form_helpers.md +79 -56
  51. data/guides/source/generators.md +24 -11
  52. data/guides/source/getting_started.md +339 -201
  53. data/guides/source/i18n.md +111 -68
  54. data/guides/source/index.html.erb +1 -0
  55. data/guides/source/initialization.md +109 -62
  56. data/guides/source/layout.html.erb +1 -4
  57. data/guides/source/layouts_and_rendering.md +18 -17
  58. data/guides/source/maintenance_policy.md +26 -4
  59. data/guides/source/nested_model_forms.md +7 -4
  60. data/guides/source/plugins.md +27 -27
  61. data/guides/source/rails_application_templates.md +21 -3
  62. data/guides/source/rails_on_rack.md +12 -9
  63. data/guides/source/routing.md +100 -74
  64. data/guides/source/ruby_on_rails_guides_guidelines.md +11 -12
  65. data/guides/source/security.md +40 -34
  66. data/guides/source/testing.md +188 -117
  67. data/guides/source/upgrading_ruby_on_rails.md +284 -29
  68. data/guides/source/working_with_javascript_in_rails.md +18 -16
  69. data/guides/w3c_validator.rb +2 -0
  70. metadata +40 -94
  71. data/guides/code/getting_started/Gemfile +0 -40
  72. data/guides/code/getting_started/Gemfile.lock +0 -125
  73. data/guides/code/getting_started/README.rdoc +0 -28
  74. data/guides/code/getting_started/Rakefile +0 -6
  75. data/guides/code/getting_started/app/assets/javascripts/application.js +0 -15
  76. data/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +0 -3
  77. data/guides/code/getting_started/app/assets/javascripts/posts.js.coffee +0 -3
  78. data/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee +0 -3
  79. data/guides/code/getting_started/app/assets/stylesheets/application.css +0 -13
  80. data/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +0 -3
  81. data/guides/code/getting_started/app/assets/stylesheets/posts.css.scss +0 -3
  82. data/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss +0 -3
  83. data/guides/code/getting_started/app/controllers/application_controller.rb +0 -5
  84. data/guides/code/getting_started/app/controllers/comments_controller.rb +0 -23
  85. data/guides/code/getting_started/app/controllers/posts_controller.rb +0 -53
  86. data/guides/code/getting_started/app/controllers/welcome_controller.rb +0 -4
  87. data/guides/code/getting_started/app/helpers/application_helper.rb +0 -2
  88. data/guides/code/getting_started/app/helpers/comments_helper.rb +0 -2
  89. data/guides/code/getting_started/app/helpers/posts_helper.rb +0 -2
  90. data/guides/code/getting_started/app/helpers/welcome_helper.rb +0 -2
  91. data/guides/code/getting_started/app/models/comment.rb +0 -3
  92. data/guides/code/getting_started/app/models/post.rb +0 -7
  93. data/guides/code/getting_started/app/views/comments/_comment.html.erb +0 -15
  94. data/guides/code/getting_started/app/views/comments/_form.html.erb +0 -13
  95. data/guides/code/getting_started/app/views/layouts/application.html.erb +0 -14
  96. data/guides/code/getting_started/app/views/posts/_form.html.erb +0 -27
  97. data/guides/code/getting_started/app/views/posts/edit.html.erb +0 -5
  98. data/guides/code/getting_started/app/views/posts/index.html.erb +0 -21
  99. data/guides/code/getting_started/app/views/posts/new.html.erb +0 -5
  100. data/guides/code/getting_started/app/views/posts/show.html.erb +0 -18
  101. data/guides/code/getting_started/app/views/welcome/index.html.erb +0 -4
  102. data/guides/code/getting_started/bin/bundle +0 -4
  103. data/guides/code/getting_started/bin/rails +0 -4
  104. data/guides/code/getting_started/bin/rake +0 -4
  105. data/guides/code/getting_started/config/application.rb +0 -18
  106. data/guides/code/getting_started/config/boot.rb +0 -4
  107. data/guides/code/getting_started/config/database.yml +0 -25
  108. data/guides/code/getting_started/config/environment.rb +0 -5
  109. data/guides/code/getting_started/config/environments/development.rb +0 -30
  110. data/guides/code/getting_started/config/environments/production.rb +0 -80
  111. data/guides/code/getting_started/config/environments/test.rb +0 -36
  112. data/guides/code/getting_started/config/initializers/backtrace_silencers.rb +0 -7
  113. data/guides/code/getting_started/config/initializers/filter_parameter_logging.rb +0 -4
  114. data/guides/code/getting_started/config/initializers/inflections.rb +0 -16
  115. data/guides/code/getting_started/config/initializers/locale.rb +0 -9
  116. data/guides/code/getting_started/config/initializers/mime_types.rb +0 -5
  117. data/guides/code/getting_started/config/initializers/secret_token.rb +0 -12
  118. data/guides/code/getting_started/config/initializers/session_store.rb +0 -3
  119. data/guides/code/getting_started/config/initializers/wrap_parameters.rb +0 -14
  120. data/guides/code/getting_started/config/locales/en.yml +0 -23
  121. data/guides/code/getting_started/config/routes.rb +0 -7
  122. data/guides/code/getting_started/config.ru +0 -4
  123. data/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb +0 -10
  124. data/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb +0 -11
  125. data/guides/code/getting_started/db/schema.rb +0 -33
  126. data/guides/code/getting_started/db/seeds.rb +0 -7
  127. data/guides/code/getting_started/public/404.html +0 -60
  128. data/guides/code/getting_started/public/422.html +0 -60
  129. data/guides/code/getting_started/public/500.html +0 -59
  130. data/guides/code/getting_started/public/favicon.ico +0 -0
  131. data/guides/code/getting_started/public/robots.txt +0 -5
  132. data/guides/code/getting_started/test/controllers/comments_controller_test.rb +0 -7
  133. data/guides/code/getting_started/test/controllers/posts_controller_test.rb +0 -7
  134. data/guides/code/getting_started/test/controllers/welcome_controller_test.rb +0 -9
  135. data/guides/code/getting_started/test/fixtures/comments.yml +0 -11
  136. data/guides/code/getting_started/test/fixtures/posts.yml +0 -9
  137. data/guides/code/getting_started/test/helpers/comments_helper_test.rb +0 -4
  138. data/guides/code/getting_started/test/helpers/posts_helper_test.rb +0 -4
  139. data/guides/code/getting_started/test/helpers/welcome_helper_test.rb +0 -4
  140. data/guides/code/getting_started/test/models/comment_test.rb +0 -7
  141. data/guides/code/getting_started/test/models/post_test.rb +0 -7
  142. data/guides/code/getting_started/test/test_helper.rb +0 -12
@@ -45,36 +45,14 @@ $ cd rails
45
45
 
46
46
  The test suite must pass with any submitted code. No matter whether you are writing a new patch, or evaluating someone else's, you need to be able to run the tests.
47
47
 
48
- Install first libxml2 and libxslt together with their development files for Nokogiri. In Ubuntu that's
48
+ Install first SQLite3 and its development files for the `sqlite3` gem. Mac OS X
49
+ users are done with:
49
50
 
50
51
  ```bash
51
- $ sudo apt-get install libxml2 libxml2-dev libxslt1-dev
52
+ $ brew install sqlite3
52
53
  ```
53
54
 
54
- If you are on Fedora or CentOS, you can run
55
-
56
- ```bash
57
- $ sudo yum install libxml2 libxml2-devel libxslt libxslt-devel
58
- ```
59
-
60
- If you are running Arch Linux, you're done with:
61
-
62
- ```bash
63
- $ sudo pacman -S libxml2 libxslt
64
- ```
65
-
66
- On FreeBSD, you just have to run:
67
-
68
- ```bash
69
- # pkg_add -r libxml2 libxslt
70
- ```
71
-
72
- Alternatively, you can install the `textproc/libxml2` and `textproc/libxslt`
73
- ports.
74
-
75
- If you have any problems with these libraries, you can install them manually by compiling the source code. Just follow the instructions at the [Red Hat/CentOS section of the Nokogiri tutorials](http://nokogiri.org/tutorials/installing_nokogiri.html#red_hat__centos) .
76
-
77
- Also, SQLite3 and its development files for the `sqlite3-ruby` gem - in Ubuntu you're done with just
55
+ In Ubuntu you're done with just:
78
56
 
79
57
  ```bash
80
58
  $ sudo apt-get install sqlite3 libsqlite3-dev
@@ -95,12 +73,12 @@ $ sudo pacman -S sqlite
95
73
  For FreeBSD users, you're done with:
96
74
 
97
75
  ```bash
98
- # pkg_add -r sqlite3
76
+ # pkg install sqlite3
99
77
  ```
100
78
 
101
79
  Or compile the `databases/sqlite3` port.
102
80
 
103
- Get a recent version of [Bundler](http://gembundler.com/)
81
+ Get a recent version of [Bundler](http://bundler.io/)
104
82
 
105
83
  ```bash
106
84
  $ gem install bundler
@@ -117,7 +95,7 @@ This command will install all dependencies except the MySQL and PostgreSQL Ruby
117
95
 
118
96
  NOTE: If you would like to run the tests that use memcached, you need to ensure that you have it installed and running.
119
97
 
120
- You can use homebrew to install memcached on OSX:
98
+ You can use [Homebrew](http://brew.sh/) to install memcached on OS X:
121
99
 
122
100
  ```bash
123
101
  $ brew install memcached
@@ -135,6 +113,20 @@ Or use yum on Fedora or CentOS:
135
113
  $ sudo yum install memcached
136
114
  ```
137
115
 
116
+ If you are running on Arch Linux:
117
+
118
+ ```bash
119
+ $ sudo pacman -S memcached
120
+ ```
121
+
122
+ For FreeBSD users, you're done with:
123
+
124
+ ```bash
125
+ # pkg install memcached
126
+ ```
127
+
128
+ Alternatively, you can compile the `databases/memcached` port.
129
+
138
130
  With the dependencies now installed, you can run the test suite with:
139
131
 
140
132
  ```bash
@@ -181,7 +173,19 @@ The Active Record test suite requires a custom config file: `activerecord/test/c
181
173
 
182
174
  #### MySQL and PostgreSQL
183
175
 
184
- To be able to run the suite for MySQL and PostgreSQL we need their gems. Install first the servers, their client libraries, and their development files. In Ubuntu just run
176
+ To be able to run the suite for MySQL and PostgreSQL we need their gems. Install
177
+ first the servers, their client libraries, and their development files.
178
+
179
+ On OS X, you can run:
180
+
181
+ ```bash
182
+ $ brew install mysql
183
+ $ brew install postgresql
184
+ ```
185
+
186
+ Follow the instructions given by Homebrew to start these.
187
+
188
+ In Ubuntu just run:
185
189
 
186
190
  ```bash
187
191
  $ sudo apt-get install mysql-server libmysqlclient15-dev
@@ -206,8 +210,8 @@ $ sudo pacman -S postgresql postgresql-libs
206
210
  FreeBSD users will have to run the following:
207
211
 
208
212
  ```bash
209
- # pkg_add -r mysql56-client mysql56-server
210
- # pkg_add -r postgresql92-client postgresql92-server
213
+ # pkg install mysql56-client mysql56-server
214
+ # pkg install postgresql93-client postgresql93-server
211
215
  ```
212
216
 
213
217
  Or install them through ports (they are located under the `databases` folder).
@@ -241,20 +245,27 @@ and create the test databases:
241
245
 
242
246
  ```bash
243
247
  $ cd activerecord
244
- $ bundle exec rake mysql:build_databases
248
+ $ bundle exec rake db:mysql:build
245
249
  ```
246
250
 
247
- PostgreSQL's authentication works differently. A simple way to set up the development environment for example is to run with your development account
251
+ PostgreSQL's authentication works differently. To setup the development environment
252
+ with your development account, on Linux or BSD, you just have to run:
248
253
 
249
254
  ```bash
250
255
  $ sudo -u postgres createuser --superuser $USER
251
256
  ```
252
257
 
253
- and then create the test databases with
258
+ and for OS X:
259
+
260
+ ```bash
261
+ $ createuser --superuser $USER
262
+ ```
263
+
264
+ Then you need to create the test databases with
254
265
 
255
266
  ```bash
256
267
  $ cd activerecord
257
- $ bundle exec rake postgresql:build_databases
268
+ $ bundle exec rake db:postgresql:build
258
269
  ```
259
270
 
260
271
  It is possible to build databases for both PostgreSQL and MySQL with
@@ -13,8 +13,8 @@
13
13
  url: active_record_basics.html
14
14
  description: This guide will get you started with models, persistence to database and the Active Record pattern and library.
15
15
  -
16
- name: Rails Database Migrations
17
- url: migrations.html
16
+ name: Active Record Migrations
17
+ url: active_record_migrations.html
18
18
  description: This guide covers how you can use Active Record migrations to alter your database in a structured and organized manner.
19
19
  -
20
20
  name: Active Record Validations
@@ -32,6 +32,11 @@
32
32
  name: Active Record Query Interface
33
33
  url: active_record_querying.html
34
34
  description: This guide covers the database query interface provided by Active Record.
35
+ -
36
+ name: Active Model basics
37
+ url: active_model_basics.html
38
+ description: This guide covers the use of model classes without Active Record.
39
+ work_in_progress: true
35
40
  -
36
41
  name: Views
37
42
  documents:
@@ -74,6 +79,10 @@
74
79
  name: Action Mailer Basics
75
80
  url: action_mailer_basics.html
76
81
  description: This guide describes how to use Action Mailer to send and receive emails.
82
+ -
83
+ name: Active Job Basics
84
+ url: active_job_basics.html
85
+ description: This guide provides you with all you need to get started in creating, enqueueing and executing background jobs.
77
86
  -
78
87
  name: Testing Rails Applications
79
88
  url: testing.html
@@ -95,11 +104,6 @@
95
104
  name: Rails Command Line Tools and Rake Tasks
96
105
  url: command_line.html
97
106
  description: This guide covers the command line tools and rake tasks provided by Rails.
98
- -
99
- name: Caching with Rails
100
- work_in_progress: true
101
- url: caching_with_rails.html
102
- description: Various caching techniques provided by Rails.
103
107
  -
104
108
  name: Asset Pipeline
105
109
  url: asset_pipeline.html
@@ -118,6 +122,10 @@
118
122
  work_in_progress: true
119
123
  url: initialization.html
120
124
  description: This guide explains the internals of the Rails initialization process as of Rails 4
125
+ -
126
+ name: Constant Autoloading and Reloading
127
+ url: constant_autoloading_and_reloading.html
128
+ description: This guide documents how constant autoloading and reloading work.
121
129
  -
122
130
  name: Extending Rails
123
131
  documents:
@@ -163,6 +171,10 @@
163
171
  name: Upgrading Ruby on Rails
164
172
  url: upgrading_ruby_on_rails.html
165
173
  description: This guide helps in upgrading applications to latest Ruby on Rails versions.
174
+ -
175
+ name: Ruby on Rails 4.2 Release Notes
176
+ url: 4_2_release_notes.html
177
+ description: Release notes for Rails 4.2.
166
178
  -
167
179
  name: Ruby on Rails 4.1 Release Notes
168
180
  url: 4_1_release_notes.html