rails 4.1.7 → 4.1.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6ac324a2743547f2b85a6f6e629c689fc65a4ad
4
- data.tar.gz: de0b09483d43413a1a31b5239799873132eaa46a
3
+ metadata.gz: fcaff3458f45aba96c6c273e29e1a997f2e06026
4
+ data.tar.gz: 3b96f72398dd22d6fa9ce238e495aa55349b236f
5
5
  SHA512:
6
- metadata.gz: 43001dc8a569339d729cdb96c31af8ea6d208f4638f56081472e3da48797968cb81f5e097c16c92ab5404c7e979bca59bee1bb658a66385c0d46660339dab487
7
- data.tar.gz: ca3732187041015407f4a837bd85e16347ecacf2f532ca3191acce1ffbb73f4228b2f53e923a80a7508431a6db87282c554ed9d8aabc4231c0318076780368d4
6
+ metadata.gz: da53fcaa591ba1b1b7f36af397e67397acb2f580c153c039eddd327e34badaa3227392b8dae6b9fc2953ad6385337ef218d21e1a3e77642b43899308ec535fcf
7
+ data.tar.gz: 7170c0c53d26d23db10d25681b1677b9c299a6ac8b2bfabdaec522b2bdf7d2efe66f1d4317657e3e05f5967b174d0de0f1ae76c5cecaa50dd44e2c8cce6ad37a
data/guides/CHANGELOG.md CHANGED
@@ -1,3 +1,63 @@
1
+ ## Rails 4.1.15 (March 07, 2016) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 4.1.14.2 (February 26, 2016) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 4.1.14.1 (January 25, 2015) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 4.1.14 (November 12, 2015) ##
17
+
18
+ * No changes.
19
+
20
+
21
+ ## Rails 4.1.13 (August 24, 2015) ##
22
+
23
+ * No changes.
24
+
25
+
26
+ ## Rails 4.1.12 (June 25, 2015) ##
27
+
28
+ * No changes.
29
+
30
+
31
+ ## Rails 4.1.11 (June 16, 2015) ##
32
+
33
+ * No changes.
34
+
35
+
36
+ ## Rails 4.1.10 (March 19, 2015) ##
37
+
38
+ * No changes.
39
+
40
+
41
+ ## Rails 4.1.9 (January 6, 2015) ##
42
+
43
+ * No changes.
44
+
45
+
46
+ ## Rails 4.1.8 (November 16, 2014) ##
47
+
48
+ * No changes.
49
+
50
+
51
+ ## Rails 4.1.7.1 (November 19, 2014) ##
52
+
53
+ * No changes.
54
+
55
+
56
+ ## Rails 4.1.7 (October 29, 2014) ##
57
+
58
+ * No changes.
59
+
60
+
1
61
  ## Rails 4.1.6 (September 11, 2014) ##
2
62
 
3
63
  * No changes.
@@ -7,8 +7,8 @@ require 'action_controller/railtie'
7
7
  class TestApp < Rails::Application
8
8
  config.root = File.dirname(__FILE__)
9
9
  config.session_store :cookie_store, key: 'cookie_store_key'
10
- config.secret_token = 'secret_token'
11
- config.secret_key_base = 'secret_key_base'
10
+ secrets.secret_token = 'secret_token'
11
+ secrets.secret_key_base = 'secret_key_base'
12
12
 
13
13
  config.logger = Logger.new($stdout)
14
14
  Rails.logger = config.logger
@@ -16,8 +16,8 @@ require 'action_controller/railtie'
16
16
  class TestApp < Rails::Application
17
17
  config.root = File.dirname(__FILE__)
18
18
  config.session_store :cookie_store, key: 'cookie_store_key'
19
- config.secret_token = 'secret_token'
20
- config.secret_key_base = 'secret_key_base'
19
+ secrets.secret_token = 'secret_token'
20
+ secrets.secret_key_base = 'secret_key_base'
21
21
 
22
22
  config.logger = Logger.new($stdout)
23
23
  Rails.logger = config.logger
@@ -0,0 +1,15 @@
1
+ # Activate the gems you are reporting the issue against.
2
+ gem 'activesupport', '4.0.0'
3
+ require 'active_support'
4
+ require 'active_support/core_ext/object/blank'
5
+ require 'minitest/autorun'
6
+
7
+ # Ensure backward compatibility with Minitest 4
8
+ Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
9
+
10
+ class BugTest < Minitest::Test
11
+ def test_stuff
12
+ assert "zomg".present?
13
+ refute "".present?
14
+ end
15
+ end
@@ -0,0 +1,26 @@
1
+ unless File.exist?('Gemfile')
2
+ File.write('Gemfile', <<-GEMFILE)
3
+ source 'https://rubygems.org'
4
+ gem 'rails', github: 'rails/rails'
5
+ gem 'arel', github: 'rails/arel'
6
+ GEMFILE
7
+
8
+ system 'bundle'
9
+ end
10
+
11
+ require 'bundler'
12
+ Bundler.setup(:default)
13
+
14
+ require 'active_support'
15
+ require 'active_support/core_ext/object/blank'
16
+ require 'minitest/autorun'
17
+
18
+ # Ensure backward compatibility with Minitest 4
19
+ Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
20
+
21
+ class BugTest < Minitest::Test
22
+ def test_stuff
23
+ assert "zomg".present?
24
+ refute "".present?
25
+ end
26
+ end
@@ -169,7 +169,7 @@ Rails Architectural Changes
169
169
 
170
170
  The major change in Rails 3.1 is the Assets Pipeline. It makes CSS and JavaScript first-class code citizens and enables proper organization, including use in plugins and engines.
171
171
 
172
- The assets pipeline is powered by [Sprockets](https://github.com/sstephenson/sprockets) and is covered in the [Asset Pipeline](asset_pipeline.html) guide.
172
+ The assets pipeline is powered by [Sprockets](https://github.com/rails/sprockets) and is covered in the [Asset Pipeline](asset_pipeline.html) guide.
173
173
 
174
174
  ### HTTP Streaming
175
175
 
@@ -8,10 +8,10 @@ Highlights in Rails 4.1:
8
8
  * Action Pack variants
9
9
  * Action Mailer previews
10
10
 
11
- These release notes cover only the major changes. To know about various bug
12
- fixes and changes, please refer to the change logs or check out the
13
- [list of commits](https://github.com/rails/rails/commits/master) in the main
14
- 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/4-1-stable) in the main Rails
14
+ repository on GitHub.
15
15
 
16
16
  --------------------------------------------------------------------------------
17
17
 
@@ -1137,14 +1137,6 @@ If `@post.author_ids` is [1], this would return:
1137
1137
  <input name="post[author_ids][]" type="hidden" value="" />
1138
1138
  ```
1139
1139
 
1140
- #### country_options_for_select
1141
-
1142
- Returns a string of option tags for pretty much any country in the world.
1143
-
1144
- #### country_select
1145
-
1146
- Returns select and option tags for the given object and method, using country_options_for_select to generate the list of option tags.
1147
-
1148
1140
  #### option_groups_from_collection_for_select
1149
1141
 
1150
1142
  Returns a string of `option` tags, like `options_from_collection_for_select`, but groups them by `optgroup` tags based on the object relationships of the arguments.
@@ -1281,7 +1281,7 @@ The method `squish` strips leading and trailing whitespace, and substitutes runs
1281
1281
 
1282
1282
  There's also the destructive version `String#squish!`.
1283
1283
 
1284
- Note that it handles both ASCII and Unicode whitespace like mongolian vowel separator (U+180E).
1284
+ Note that it handles both ASCII and Unicode whitespace.
1285
1285
 
1286
1286
  NOTE: Defined in `active_support/core_ext/string/filters.rb`.
1287
1287
 
@@ -3003,53 +3003,6 @@ The method `Range#overlaps?` says whether any two given ranges have non-void int
3003
3003
 
3004
3004
  NOTE: Defined in `active_support/core_ext/range/overlaps.rb`.
3005
3005
 
3006
- Extensions to `Proc`
3007
- --------------------
3008
-
3009
- ### `bind`
3010
-
3011
- As you surely know Ruby has an `UnboundMethod` class whose instances are methods that belong to the limbo of methods without a self. The method `Module#instance_method` returns an unbound method for example:
3012
-
3013
- ```ruby
3014
- Hash.instance_method(:delete) # => #<UnboundMethod: Hash#delete>
3015
- ```
3016
-
3017
- An unbound method is not callable as is, you need to bind it first to an object with `bind`:
3018
-
3019
- ```ruby
3020
- clear = Hash.instance_method(:clear)
3021
- clear.bind({a: 1}).call # => {}
3022
- ```
3023
-
3024
- Active Support defines `Proc#bind` with an analogous purpose:
3025
-
3026
- ```ruby
3027
- Proc.new { size }.bind([]).call # => 0
3028
- ```
3029
-
3030
- As you see that's callable and bound to the argument, the return value is indeed a `Method`.
3031
-
3032
- NOTE: To do so `Proc#bind` actually creates a method under the hood. If you ever see a method with a weird name like `__bind_1256598120_237302` in a stack trace you know now where it comes from.
3033
-
3034
- Action Pack uses this trick in `rescue_from` for example, which accepts the name of a method and also a proc as callbacks for a given rescued exception. It has to call them in either case, so a bound method is returned by `handler_for_rescue`, thus simplifying the code in the caller:
3035
-
3036
- ```ruby
3037
- def handler_for_rescue(exception)
3038
- _, rescuer = Array(rescue_handlers).reverse.detect do |klass_name, handler|
3039
- ...
3040
- end
3041
-
3042
- case rescuer
3043
- when Symbol
3044
- method(rescuer)
3045
- when Proc
3046
- rescuer.bind(self)
3047
- end
3048
- end
3049
- ```
3050
-
3051
- NOTE: Defined in `active_support/core_ext/proc.rb`.
3052
-
3053
3006
  Extensions to `Date`
3054
3007
  --------------------
3055
3008
 
@@ -208,7 +208,7 @@ information on how precompiling works.
208
208
  NOTE: You must have an ExecJS supported runtime in order to use CoffeeScript.
209
209
  If you are using Mac OS X or Windows, you have a JavaScript runtime installed in
210
210
  your operating system. Check
211
- [ExecJS](https://github.com/sstephenson/execjs#readme) documentation to know all
211
+ [ExecJS](https://github.com/rails/execjs#readme) documentation to know all
212
212
  supported JavaScript runtimes.
213
213
 
214
214
  You can also disable generation of controller specific asset files by adding the
@@ -969,7 +969,7 @@ The following line invokes `uglifier` for JavaScript compression.
969
969
  config.assets.js_compressor = :uglifier
970
970
  ```
971
971
 
972
- NOTE: You will need an [ExecJS](https://github.com/sstephenson/execjs#readme)
972
+ NOTE: You will need an [ExecJS](https://github.com/rails/execjs#readme)
973
973
  supported runtime in order to use `uglifier`. If you are using Mac OS X or
974
974
  Windows you have a JavaScript runtime installed in your operating system.
975
975
 
@@ -590,11 +590,11 @@ This is the final step required to get the new comment form working. Displaying
590
590
  the comments, however, is not quite right yet. If you were to create a comment
591
591
  right now, you would see this error:
592
592
 
593
- ```
593
+ ```
594
594
  Missing partial blorgh/comments/comment with {:handlers=>[:erb, :builder],
595
595
  :formats=>[:html], :locale=>[:en, :en]}. Searched in: *
596
596
  "/Users/ryan/Sites/side_projects/blorgh/test/dummy/app/views" *
597
- "/Users/ryan/Sites/side_projects/blorgh/app/views"
597
+ "/Users/ryan/Sites/side_projects/blorgh/app/views"
598
598
  ```
599
599
 
600
600
  The engine is unable to find the partial required for rendering the comments.
@@ -828,12 +828,12 @@ $ bin/rake blorgh:install:migrations
828
828
  Notice that only _one_ migration was copied over here. This is because the first
829
829
  two migrations were copied over the first time this command was run.
830
830
 
831
- ```
831
+ ```
832
832
  NOTE Migration [timestamp]_create_blorgh_posts.rb from blorgh has been
833
833
  skipped. Migration with the same name already exists. NOTE Migration
834
834
  [timestamp]_create_blorgh_comments.rb from blorgh has been skipped. Migration
835
835
  with the same name already exists. Copied migration
836
- [timestamp]_add_author_id_to_blorgh_posts.rb from blorgh
836
+ [timestamp]_add_author_id_to_blorgh_posts.rb from blorgh
837
837
  ```
838
838
 
839
839
  Run the migration using:
@@ -1036,22 +1036,43 @@ functionality, especially controllers. This means that if you were to make a
1036
1036
  typical `GET` to a controller in a controller's functional test like this:
1037
1037
 
1038
1038
  ```ruby
1039
- get :index
1039
+ module Blorgh
1040
+ class FooControllerTest < ActionController::TestCase
1041
+ def test_index
1042
+ get :index
1043
+ ...
1044
+ end
1045
+ end
1046
+ end
1040
1047
  ```
1041
1048
 
1042
1049
  It may not function correctly. This is because the application doesn't know how
1043
1050
  to route these requests to the engine unless you explicitly tell it **how**. To
1044
- do this, you must also pass the `:use_route` option as a parameter on these
1045
- requests:
1051
+ do this, you must set the `@routes` instance variable to the engine's route set
1052
+ in your setup code:
1046
1053
 
1047
1054
  ```ruby
1048
- get :index, use_route: :blorgh
1055
+ module Blorgh
1056
+ class FooControllerTest < ActionController::TestCase
1057
+ setup do
1058
+ @routes = Engine.routes
1059
+ end
1060
+
1061
+ def test_index
1062
+ get :index
1063
+ ...
1064
+ end
1065
+ end
1066
+ end
1049
1067
  ```
1050
1068
 
1051
1069
  This tells the application that you still want to perform a `GET` request to the
1052
1070
  `index` action of this controller, but you want to use the engine's route to get
1053
1071
  there, rather than the application's one.
1054
1072
 
1073
+ This also ensures that the engine's URL helpers will work as expected in your
1074
+ tests.
1075
+
1055
1076
  Improving engine functionality
1056
1077
  ------------------------------
1057
1078
 
@@ -199,7 +199,7 @@ gem to the generated `Gemfile` in a commented line for new apps and you can
199
199
  uncomment if you need it. `therubyrhino` is the recommended runtime for JRuby
200
200
  users and is added by default to the `Gemfile` in apps generated under JRuby.
201
201
  You can investigate about all the supported runtimes at
202
- [ExecJS](https://github.com/sstephenson/execjs#readme).
202
+ [ExecJS](https://github.com/rails/execjs#readme).
203
203
 
204
204
  This will fire up WEBrick, a web server distributed with Ruby by default. To see
205
205
  your application in action, open a browser window and navigate to
@@ -356,7 +356,7 @@ Refer to the Injection section for countermeasures against XSS. It is _recommend
356
356
 
357
357
  **CSRF** Cross-Site Request Forgery (CSRF), also known as Cross-Site Reference Forgery (XSRF), is a gigantic attack method, it allows the attacker to do everything the administrator or Intranet user may do. As you have already seen above how CSRF works, here are a few examples of what attackers can do in the Intranet or admin interface.
358
358
 
359
- A real-world example is a [router reconfiguration by CSRF](http://www.h-online.com/security/Symantec-reports-first-active-attack-on-a-DSL-router--/news/102352). The attackers sent a malicious e-mail, with CSRF in it, to Mexican users. The e-mail claimed there was an e-card waiting for them, but it also contained an image tag that resulted in a HTTP-GET request to reconfigure the user's router (which is a popular model in Mexico). The request changed the DNS-settings so that requests to a Mexico-based banking site would be mapped to the attacker's site. Everyone who accessed the banking site through that router saw the attacker's fake web site and had their credentials stolen.
359
+ A real-world example is a [router reconfiguration by CSRF](http://www.h-online.com/security/news/item/Symantec-reports-first-active-attack-on-a-DSL-router-735883.html). The attackers sent a malicious e-mail, with CSRF in it, to Mexican users. The e-mail claimed there was an e-card waiting for them, but it also contained an image tag that resulted in a HTTP-GET request to reconfigure the user's router (which is a popular model in Mexico). The request changed the DNS-settings so that requests to a Mexico-based banking site would be mapped to the attacker's site. Everyone who accessed the banking site through that router saw the attacker's fake web site and had their credentials stolen.
360
360
 
361
361
  Another example changed Google Adsense's e-mail address and password by. If the victim was logged into Google Adsense, the administration interface for Google advertisements campaigns, an attacker could change their credentials.

362
362
 
@@ -712,7 +712,7 @@ class UserFlowsTest < ActionDispatch::IntegrationTest
712
712
  https!(false)
713
713
  get "/posts/all"
714
714
  assert_response :success
715
- assert assigns(:products)
715
+ assert assigns(:posts)
716
716
  end
717
717
  end
718
718
  ```
@@ -277,7 +277,7 @@ included in the newly introduced `ActiveRecord::FixtureSet.context_class`, in
277
277
  `test_helper.rb`.
278
278
 
279
279
  ```ruby
280
- class FixtureFileHelpers
280
+ module FixtureFileHelpers
281
281
  def file_sha(path)
282
282
  Digest::SHA2.hexdigest(File.read(Rails.root.join('test/fixtures', path)))
283
283
  end
@@ -541,7 +541,7 @@ file (in `config/application.rb`):
541
541
  ```ruby
542
542
  # Require the gems listed in Gemfile, including any gems
543
543
  # you've limited to :test, :development, or :production.
544
- Bundler.require(:default, Rails.env)
544
+ Bundler.require(*Rails.groups)
545
545
  ```
546
546
 
547
547
  ### vendor/plugins
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.7
4
+ version: 4.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.7
19
+ version: 4.1.15
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.1.7
26
+ version: 4.1.15
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.1.7
33
+ version: 4.1.15
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.1.7
40
+ version: 4.1.15
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: actionview
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 4.1.7
47
+ version: 4.1.15
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 4.1.7
54
+ version: 4.1.15
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activemodel
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 4.1.7
61
+ version: 4.1.15
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 4.1.7
68
+ version: 4.1.15
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activerecord
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 4.1.7
75
+ version: 4.1.15
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 4.1.7
82
+ version: 4.1.15
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: actionmailer
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 4.1.7
89
+ version: 4.1.15
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 4.1.7
96
+ version: 4.1.15
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: railties
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 4.1.7
103
+ version: 4.1.15
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 4.1.7
110
+ version: 4.1.15
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: bundler
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -294,6 +294,8 @@ files:
294
294
  - guides/bug_report_templates/action_controller_master.rb
295
295
  - guides/bug_report_templates/active_record_gem.rb
296
296
  - guides/bug_report_templates/active_record_master.rb
297
+ - guides/bug_report_templates/generic_gem.rb
298
+ - guides/bug_report_templates/generic_master.rb
297
299
  - guides/code/getting_started/Gemfile
298
300
  - guides/code/getting_started/Gemfile.lock
299
301
  - guides/code/getting_started/README.rdoc
@@ -452,7 +454,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
452
454
  version: 1.8.11
453
455
  requirements: []
454
456
  rubyforge_project:
455
- rubygems_version: 2.2.2
457
+ rubygems_version: 2.5.1
456
458
  signing_key:
457
459
  specification_version: 4
458
460
  summary: Full-stack web application framework.