rails 4.0.0 → 4.0.1.rc1

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/guides/CHANGELOG.md +6 -0
  3. data/guides/assets/images/akshaysurve.jpg +0 -0
  4. data/guides/bug_report_templates/action_controller_gem.rb +42 -0
  5. data/guides/bug_report_templates/action_controller_master.rb +51 -0
  6. data/guides/code/getting_started/Gemfile +1 -1
  7. data/guides/code/getting_started/Gemfile.lock +76 -106
  8. data/guides/code/getting_started/app/controllers/comments_controller.rb +7 -1
  9. data/guides/code/getting_started/app/controllers/posts_controller.rb +8 -2
  10. data/guides/code/getting_started/app/views/posts/_form.html.erb +3 -3
  11. data/guides/code/getting_started/app/views/welcome/index.html.erb +1 -0
  12. data/guides/code/getting_started/test/fixtures/comments.yml +1 -1
  13. data/guides/code/getting_started/test/fixtures/posts.yml +1 -1
  14. data/guides/rails_guides.rb +20 -1
  15. data/guides/source/3_0_release_notes.md +0 -2
  16. data/guides/source/4_0_release_notes.md +30 -13
  17. data/guides/source/_welcome.html.erb +4 -1
  18. data/guides/source/action_controller_overview.md +2 -2
  19. data/guides/source/action_mailer_basics.md +6 -21
  20. data/guides/source/action_view_overview.md +2 -71
  21. data/guides/source/active_record_basics.md +9 -9
  22. data/guides/source/active_record_callbacks.md +1 -0
  23. data/guides/source/active_record_querying.md +45 -5
  24. data/guides/source/active_record_validations.md +6 -9
  25. data/guides/source/active_support_core_extensions.md +50 -1
  26. data/guides/source/asset_pipeline.md +10 -4
  27. data/guides/source/association_basics.md +8 -4
  28. data/guides/source/command_line.md +8 -8
  29. data/guides/source/configuring.md +4 -2
  30. data/guides/source/contributing_to_ruby_on_rails.md +60 -10
  31. data/guides/source/credits.html.erb +5 -1
  32. data/guides/source/debugging_rails_applications.md +4 -2
  33. data/guides/source/documents.yaml +7 -0
  34. data/guides/source/form_helpers.md +1 -1
  35. data/guides/source/generators.md +21 -6
  36. data/guides/source/getting_started.md +61 -54
  37. data/guides/source/i18n.md +7 -6
  38. data/guides/source/layout.html.erb +6 -8
  39. data/guides/source/layouts_and_rendering.md +4 -4
  40. data/guides/source/maintenance_policy.md +56 -0
  41. data/guides/source/migrations.md +13 -11
  42. data/guides/source/plugins.md +9 -3
  43. data/guides/source/rails_on_rack.md +5 -1
  44. data/guides/source/security.md +1 -1
  45. data/guides/source/testing.md +83 -23
  46. data/guides/source/upgrading_ruby_on_rails.md +36 -12
  47. metadata +17 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c148de96944cdc710c952ce6e00ea9c908d4023c
4
- data.tar.gz: 4aab2814d3df58278f6d8d8cda0d3f00bd261382
3
+ metadata.gz: f1854e25df41e03116784dd9dae84e811ca1eb62
4
+ data.tar.gz: 1222236c3196d2c320bf84a1f140328ea8cbe8fe
5
5
  SHA512:
6
- metadata.gz: a4d284b3843be9401d64129127c5ebc88238d16a24ec10f6f6309f43d3c0d3a8bb163e1097d3782dbf39a76154e1f3bfff0291252f4cedcb10a59db7c12e60ad
7
- data.tar.gz: 8f323b334a9dd4aad5d0d791e43f00e51b56d4b2f2323c6f8ee9c5e65598450c1e896f575673ce94588efdd5f80e8e1b1fe593d2a5bb35b539a477dfcce81200
6
+ metadata.gz: 60de93c8a6751ee01253fc1a05fc35a21de929c335d72ae09357d15c87a79b64358442637a3c84e30b2f98df687bdd6b20822cdc6001f052561f19edd6071e22
7
+ data.tar.gz: 57bb4ffd4eeb50433b98f73fbbc3b25044ac13a426cd1a8c9b88c94f483a66b43f2db18e4c2a21c6e54ec7b1a6875e71f57cc132994c48e541e86a4b1f203ca3
@@ -1,3 +1,9 @@
1
+ ## unreleased ##
2
+
3
+ * Added the Rails maintenance policy to the guides.
4
+
5
+ *Matias Korhonen*
6
+
1
7
  ## Rails 4.0.0 (June 25, 2013) ##
2
8
 
3
9
  * Change Service pages(404, etc). *Stanislav Sobolev*
@@ -0,0 +1,42 @@
1
+ # Activate the gem you are reporting the issue against.
2
+ gem 'rails', '4.0.0'
3
+
4
+ require 'rails'
5
+ require 'action_controller/railtie'
6
+
7
+ class TestApp < Rails::Application
8
+ config.root = File.dirname(__FILE__)
9
+ config.session_store :cookie_store, key: 'cookie_store_key'
10
+ config.secret_token = 'secret_token'
11
+ config.secret_key_base = 'secret_key_base'
12
+
13
+ config.logger = Logger.new($stdout)
14
+ Rails.logger = config.logger
15
+
16
+ routes.draw do
17
+ get '/' => 'test#index'
18
+ end
19
+ end
20
+
21
+ class TestController < ActionController::Base
22
+ def index
23
+ render text: 'Home'
24
+ end
25
+ end
26
+
27
+ require 'minitest/autorun'
28
+ require 'rack/test'
29
+
30
+ class BugTest < MiniTest::Unit::TestCase
31
+ include Rack::Test::Methods
32
+
33
+ def test_returns_success
34
+ get '/'
35
+ assert last_response.ok?
36
+ end
37
+
38
+ private
39
+ def app
40
+ Rails.application
41
+ end
42
+ end
@@ -0,0 +1,51 @@
1
+ unless File.exists?('Gemfile')
2
+ File.write('Gemfile', <<-GEMFILE)
3
+ source 'https://rubygems.org'
4
+ gem 'rails', github: 'rails/rails'
5
+ GEMFILE
6
+
7
+ system 'bundle'
8
+ end
9
+
10
+ require 'bundler'
11
+ Bundler.setup(:default)
12
+
13
+ require 'rails'
14
+ require 'action_controller/railtie'
15
+
16
+ class TestApp < Rails::Application
17
+ config.root = File.dirname(__FILE__)
18
+ config.session_store :cookie_store, key: 'cookie_store_key'
19
+ config.secret_token = 'secret_token'
20
+ config.secret_key_base = 'secret_key_base'
21
+
22
+ config.logger = Logger.new($stdout)
23
+ Rails.logger = config.logger
24
+
25
+ routes.draw do
26
+ get '/' => 'test#index'
27
+ end
28
+ end
29
+
30
+ class TestController < ActionController::Base
31
+ def index
32
+ render text: 'Home'
33
+ end
34
+ end
35
+
36
+ require 'minitest/autorun'
37
+ require 'rack/test'
38
+
39
+ class BugTest < Minitest::Test
40
+ include Rack::Test::Methods
41
+
42
+ def test_returns_success
43
+ get '/'
44
+ assert last_response.ok?
45
+ end
46
+
47
+ private
48
+ def app
49
+ Rails.application
50
+ end
51
+ end
@@ -31,7 +31,7 @@ end
31
31
  gem 'jbuilder', '~> 1.2'
32
32
 
33
33
  # To use ActiveModel has_secure_password
34
- # gem 'bcrypt-ruby', '~> 3.0.0'
34
+ # gem 'bcrypt-ruby', '~> 3.1.2'
35
35
 
36
36
  # Use unicorn as the app server
37
37
  # gem 'unicorn'
@@ -1,135 +1,107 @@
1
- GIT
2
- remote: git://github.com/rails/activerecord-deprecated_finders.git
3
- revision: 2e7b35d7948cefb2bba96438873d7f7bb1961a03
4
- specs:
5
- activerecord-deprecated_finders (0.0.2)
6
-
7
- GIT
8
- remote: git://github.com/rails/arel.git
9
- revision: 38d0a222e275d917a2c1d093b24457bafb600a00
10
- specs:
11
- arel (3.0.2.20120819075748)
12
-
13
- GIT
14
- remote: git://github.com/rails/coffee-rails.git
15
- revision: 052634e6d02d4800d7b021201cc8d5829775b3cd
16
- specs:
17
- coffee-rails (4.0.0.beta)
18
- coffee-script (>= 2.2.0)
19
- railties (>= 4.0.0.beta, < 5.0)
20
-
21
- GIT
22
- remote: git://github.com/rails/sass-rails.git
23
- revision: ae8138a89cac397c0df903dd533e2862902ce8f5
24
- specs:
25
- sass-rails (4.0.0.beta)
26
- railties (>= 4.0.0.beta, < 5.0)
27
- sass (>= 3.1.10)
28
- sprockets-rails (~> 2.0.0.rc0)
29
- tilt (~> 1.3)
30
-
31
- GIT
32
- remote: git://github.com/rails/sprockets-rails.git
33
- revision: 09917104fdb42245fe369612a7b0e3d77e1ba763
34
- specs:
35
- sprockets-rails (2.0.0.rc1)
36
- actionpack (>= 3.0)
37
- activesupport (>= 3.0)
38
- sprockets (~> 2.8)
39
-
40
- PATH
41
- remote: /Users/steve/src/rails
1
+ GEM
2
+ remote: https://rubygems.org/
42
3
  specs:
43
- actionmailer (4.0.0.beta)
44
- actionpack (= 4.0.0.beta)
4
+ actionmailer (4.0.0)
5
+ actionpack (= 4.0.0)
45
6
  mail (~> 2.5.3)
46
- actionpack (4.0.0.beta)
47
- activesupport (= 4.0.0.beta)
7
+ actionpack (4.0.0)
8
+ activesupport (= 4.0.0)
48
9
  builder (~> 3.1.0)
49
10
  erubis (~> 2.7.0)
50
- rack (~> 1.4.3)
51
- rack-test (~> 0.6.1)
52
- activemodel (4.0.0.beta)
53
- activesupport (= 4.0.0.beta)
11
+ rack (~> 1.5.2)
12
+ rack-test (~> 0.6.2)
13
+ activemodel (4.0.0)
14
+ activesupport (= 4.0.0)
54
15
  builder (~> 3.1.0)
55
- activerecord (4.0.0.beta)
56
- activemodel (= 4.0.0.beta)
57
- activerecord-deprecated_finders (= 0.0.2)
58
- activesupport (= 4.0.0.beta)
59
- arel (~> 3.0.2)
60
- activesupport (4.0.0.beta)
61
- i18n (~> 0.6)
62
- minitest (~> 4.1)
16
+ activerecord (4.0.0)
17
+ activemodel (= 4.0.0)
18
+ activerecord-deprecated_finders (~> 1.0.2)
19
+ activesupport (= 4.0.0)
20
+ arel (~> 4.0.0)
21
+ activerecord-deprecated_finders (1.0.3)
22
+ activesupport (4.0.0)
23
+ i18n (~> 0.6, >= 0.6.4)
24
+ minitest (~> 4.2)
63
25
  multi_json (~> 1.3)
64
26
  thread_safe (~> 0.1)
65
- tzinfo (~> 0.3.33)
66
- rails (4.0.0.beta)
67
- actionmailer (= 4.0.0.beta)
68
- actionpack (= 4.0.0.beta)
69
- activerecord (= 4.0.0.beta)
70
- activesupport (= 4.0.0.beta)
71
- bundler (>= 1.2.2, < 2.0)
72
- railties (= 4.0.0.beta)
73
- sprockets-rails (~> 2.0.0.rc1)
74
- railties (4.0.0.beta)
75
- actionpack (= 4.0.0.beta)
76
- activesupport (= 4.0.0.beta)
77
- rake (>= 0.8.7)
78
- rdoc (~> 3.4)
79
- thor (>= 0.15.4, < 2.0)
80
-
81
- GEM
82
- remote: https://rubygems.org/
83
- specs:
84
- atomic (1.0.1)
27
+ tzinfo (~> 0.3.37)
28
+ arel (4.0.0)
29
+ atomic (1.1.10)
85
30
  builder (3.1.4)
31
+ coffee-rails (4.0.0)
32
+ coffee-script (>= 2.2.0)
33
+ railties (>= 4.0.0.beta, < 5.0)
86
34
  coffee-script (2.2.0)
87
35
  coffee-script-source
88
36
  execjs
89
- coffee-script-source (1.4.0)
37
+ coffee-script-source (1.6.3)
90
38
  erubis (2.7.0)
91
39
  execjs (1.4.0)
92
40
  multi_json (~> 1.0)
93
- hike (1.2.1)
94
- i18n (0.6.1)
95
- jbuilder (1.3.0)
41
+ hike (1.2.3)
42
+ i18n (0.6.4)
43
+ jbuilder (1.4.2)
96
44
  activesupport (>= 3.0.0)
97
- jquery-rails (2.2.0)
45
+ multi_json (>= 1.2.0)
46
+ jquery-rails (3.0.2)
98
47
  railties (>= 3.0, < 5.0)
99
48
  thor (>= 0.14, < 2.0)
100
- json (1.7.6)
101
- mail (2.5.3)
102
- i18n (>= 0.4.0)
49
+ json (1.8.0)
50
+ mail (2.5.4)
103
51
  mime-types (~> 1.16)
104
52
  treetop (~> 1.4.8)
105
- mime-types (1.19)
106
- minitest (4.4.0)
107
- multi_json (1.5.0)
53
+ mime-types (1.23)
54
+ minitest (4.7.5)
55
+ multi_json (1.7.7)
108
56
  polyglot (0.3.3)
109
- rack (1.4.4)
57
+ rack (1.5.2)
110
58
  rack-test (0.6.2)
111
59
  rack (>= 1.0)
112
- rake (10.0.3)
113
- rdoc (3.12)
60
+ rails (4.0.0)
61
+ actionmailer (= 4.0.0)
62
+ actionpack (= 4.0.0)
63
+ activerecord (= 4.0.0)
64
+ activesupport (= 4.0.0)
65
+ bundler (>= 1.3.0, < 2.0)
66
+ railties (= 4.0.0)
67
+ sprockets-rails (~> 2.0.0)
68
+ railties (4.0.0)
69
+ actionpack (= 4.0.0)
70
+ activesupport (= 4.0.0)
71
+ rake (>= 0.8.7)
72
+ thor (>= 0.18.1, < 2.0)
73
+ rake (10.1.0)
74
+ rdoc (3.12.2)
114
75
  json (~> 1.4)
115
- sass (3.2.5)
116
- sprockets (2.8.2)
76
+ sass (3.2.9)
77
+ sass-rails (4.0.0)
78
+ railties (>= 4.0.0.beta, < 5.0)
79
+ sass (>= 3.1.10)
80
+ sprockets-rails (~> 2.0.0)
81
+ sdoc (0.3.20)
82
+ json (>= 1.1.3)
83
+ rdoc (~> 3.10)
84
+ sprockets (2.10.0)
117
85
  hike (~> 1.2)
118
86
  multi_json (~> 1.0)
119
87
  rack (~> 1.0)
120
88
  tilt (~> 1.1, != 1.3.0)
89
+ sprockets-rails (2.0.0)
90
+ actionpack (>= 3.0)
91
+ activesupport (>= 3.0)
92
+ sprockets (~> 2.8)
121
93
  sqlite3 (1.3.7)
122
- thor (0.16.0)
94
+ thor (0.18.1)
123
95
  thread_safe (0.1.0)
124
96
  atomic
125
- tilt (1.3.3)
126
- treetop (1.4.12)
97
+ tilt (1.4.1)
98
+ treetop (1.4.14)
127
99
  polyglot
128
100
  polyglot (>= 0.3.1)
129
- turbolinks (1.0.0)
101
+ turbolinks (1.2.0)
130
102
  coffee-rails
131
- tzinfo (0.3.35)
132
- uglifier (1.3.0)
103
+ tzinfo (0.3.37)
104
+ uglifier (2.1.1)
133
105
  execjs (>= 0.3.0)
134
106
  multi_json (~> 1.0, >= 1.0.2)
135
107
 
@@ -137,14 +109,12 @@ PLATFORMS
137
109
  ruby
138
110
 
139
111
  DEPENDENCIES
140
- activerecord-deprecated_finders!
141
- arel!
142
- coffee-rails!
143
- jbuilder (~> 1.0.1)
112
+ coffee-rails
113
+ jbuilder (~> 1.2)
144
114
  jquery-rails
145
- rails!
146
- sass-rails!
147
- sprockets-rails!
115
+ rails (= 4.0.0)
116
+ sass-rails
117
+ sdoc
148
118
  sqlite3
149
119
  turbolinks
150
120
  uglifier (>= 1.0.3)
@@ -4,7 +4,7 @@ class CommentsController < ApplicationController
4
4
 
5
5
  def create
6
6
  @post = Post.find(params[:post_id])
7
- @comment = @post.comments.create(params[:comment].permit(:commenter, :body))
7
+ @comment = @post.comments.create(comment_params)
8
8
  redirect_to post_path(@post)
9
9
  end
10
10
 
@@ -14,4 +14,10 @@ class CommentsController < ApplicationController
14
14
  @comment.destroy
15
15
  redirect_to post_path(@post)
16
16
  end
17
+
18
+ private
19
+
20
+ def comment_params
21
+ params.require(:comment).permit(:commenter, :body)
22
+ end
17
23
  end
@@ -17,7 +17,7 @@ class PostsController < ApplicationController
17
17
  def update
18
18
  @post = Post.find(params[:id])
19
19
 
20
- if @post.update(params[:post].permit(:title, :text))
20
+ if @post.update(post_params)
21
21
  redirect_to action: :show, id: @post.id
22
22
  else
23
23
  render 'edit'
@@ -29,7 +29,7 @@ class PostsController < ApplicationController
29
29
  end
30
30
 
31
31
  def create
32
- @post = Post.new(params[:post].permit(:title, :text))
32
+ @post = Post.new(post_params)
33
33
 
34
34
  if @post.save
35
35
  redirect_to action: :show, id: @post.id
@@ -44,4 +44,10 @@ class PostsController < ApplicationController
44
44
 
45
45
  redirect_to action: :index
46
46
  end
47
+
48
+ private
49
+
50
+ def post_params
51
+ params.require(:post).permit(:title, :text)
52
+ end
47
53
  end
@@ -1,6 +1,6 @@
1
1
  <%= form_for @post do |f| %>
2
2
  <% if @post.errors.any? %>
3
- <div id="errorExplanation">
3
+ <div id="error_explanation">
4
4
  <h2><%= pluralize(@post.errors.count, "error") %> prohibited
5
5
  this post from being saved:</h2>
6
6
  <ul>
@@ -14,12 +14,12 @@
14
14
  <%= f.label :title %><br>
15
15
  <%= f.text_field :title %>
16
16
  </p>
17
-
17
+
18
18
  <p>
19
19
  <%= f.label :text %><br>
20
20
  <%= f.text_area :text %>
21
21
  </p>
22
-
22
+
23
23
  <p>
24
24
  <%= f.submit %>
25
25
  </p>
@@ -1,3 +1,4 @@
1
1
  <h1>Hello, Rails!</h1>
2
2
 
3
3
  <%= link_to "My Blog", controller: "posts" %>
4
+ <%= link_to "New Post", new_post_path %>
@@ -1,4 +1,4 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
2
 
3
3
  one:
4
4
  commenter: MyString
@@ -1,4 +1,4 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
2
 
3
3
  one:
4
4
  title: MyString