rails 4.0.13 → 4.1.16

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 (122) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -17
  3. data/guides/CHANGELOG.md +68 -34
  4. data/guides/assets/images/edge_badge.png +0 -0
  5. data/guides/assets/images/feature_tile.gif +0 -0
  6. data/guides/assets/images/footer_tile.gif +0 -0
  7. data/guides/assets/images/fxn.png +0 -0
  8. data/guides/assets/images/getting_started/article_with_comments.png +0 -0
  9. data/guides/assets/images/getting_started/challenge.png +0 -0
  10. data/guides/assets/images/getting_started/confirm_dialog.png +0 -0
  11. data/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
  12. data/guides/assets/images/getting_started/form_with_errors.png +0 -0
  13. data/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
  14. data/guides/assets/images/getting_started/new_article.png +0 -0
  15. data/guides/assets/images/getting_started/rails_welcome.png +0 -0
  16. data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
  17. data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
  18. data/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
  19. data/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
  20. data/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
  21. data/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
  22. data/guides/assets/images/header_tile.gif +0 -0
  23. data/guides/assets/images/icons/README +1 -1
  24. data/guides/assets/images/icons/callouts/11.png +0 -0
  25. data/guides/assets/images/icons/callouts/12.png +0 -0
  26. data/guides/assets/images/icons/callouts/13.png +0 -0
  27. data/guides/assets/images/icons/callouts/15.png +0 -0
  28. data/guides/assets/images/icons/caution.png +0 -0
  29. data/guides/assets/images/icons/example.png +0 -0
  30. data/guides/assets/images/radar.png +0 -0
  31. data/guides/assets/images/rails4_features.png +0 -0
  32. data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
  33. data/guides/assets/images/vijaydev.jpg +0 -0
  34. data/guides/assets/javascripts/guides.js +30 -34
  35. data/guides/assets/stylesheets/main.css +2 -1
  36. data/guides/assets/stylesheets/print.css +1 -1
  37. data/guides/bug_report_templates/action_controller_gem.rb +9 -4
  38. data/guides/bug_report_templates/action_controller_master.rb +4 -2
  39. data/guides/bug_report_templates/active_record_gem.rb +5 -2
  40. data/guides/bug_report_templates/active_record_master.rb +2 -1
  41. data/guides/bug_report_templates/generic_gem.rb +15 -0
  42. data/guides/bug_report_templates/generic_master.rb +26 -0
  43. data/guides/code/getting_started/Gemfile +21 -24
  44. data/guides/code/getting_started/Gemfile.lock +78 -73
  45. data/guides/code/getting_started/Rakefile +1 -1
  46. data/guides/code/getting_started/app/assets/javascripts/application.js +1 -2
  47. data/guides/code/getting_started/app/views/layouts/application.html.erb +2 -2
  48. data/guides/code/getting_started/config/environment.rb +1 -1
  49. data/guides/code/getting_started/config/environments/development.rb +2 -2
  50. data/guides/code/getting_started/config/environments/production.rb +3 -3
  51. data/guides/code/getting_started/config/environments/test.rb +2 -2
  52. data/guides/code/getting_started/config/initializers/secret_token.rb +1 -1
  53. data/guides/code/getting_started/config/initializers/session_store.rb +1 -1
  54. data/guides/code/getting_started/config/routes.rb +1 -1
  55. data/guides/code/getting_started/config.ru +1 -1
  56. data/guides/code/getting_started/public/404.html +2 -0
  57. data/guides/code/getting_started/public/422.html +2 -0
  58. data/guides/code/getting_started/public/500.html +2 -0
  59. data/guides/code/getting_started/test/test_helper.rb +0 -3
  60. data/guides/rails_guides/helpers.rb +3 -1
  61. data/guides/source/2_2_release_notes.md +2 -2
  62. data/guides/source/2_3_release_notes.md +8 -8
  63. data/guides/source/3_0_release_notes.md +2 -3
  64. data/guides/source/3_1_release_notes.md +2 -2
  65. data/guides/source/3_2_release_notes.md +12 -12
  66. data/guides/source/4_0_release_notes.md +79 -46
  67. data/guides/source/4_1_release_notes.md +731 -0
  68. data/guides/source/_welcome.html.erb +5 -2
  69. data/guides/source/action_controller_overview.md +189 -40
  70. data/guides/source/action_mailer_basics.md +27 -27
  71. data/guides/source/action_view_overview.md +131 -20
  72. data/guides/source/active_model_basics.md +6 -6
  73. data/guides/source/active_record_basics.md +15 -15
  74. data/guides/source/active_record_callbacks.md +18 -16
  75. data/guides/source/active_record_querying.md +93 -51
  76. data/guides/source/active_record_validations.md +26 -24
  77. data/guides/source/active_support_core_extensions.md +72 -118
  78. data/guides/source/active_support_instrumentation.md +13 -4
  79. data/guides/source/api_documentation_guidelines.md +104 -6
  80. data/guides/source/asset_pipeline.md +573 -244
  81. data/guides/source/association_basics.md +94 -22
  82. data/guides/source/caching_with_rails.md +15 -6
  83. data/guides/source/command_line.md +55 -46
  84. data/guides/source/configuring.md +248 -52
  85. data/guides/source/contributing_to_ruby_on_rails.md +18 -17
  86. data/guides/source/credits.html.erb +2 -2
  87. data/guides/source/debugging_rails_applications.md +39 -8
  88. data/guides/source/development_dependencies_install.md +91 -8
  89. data/guides/source/documents.yaml +4 -0
  90. data/guides/source/engines.md +678 -232
  91. data/guides/source/form_helpers.md +53 -35
  92. data/guides/source/generators.md +19 -15
  93. data/guides/source/getting_started.md +758 -497
  94. data/guides/source/i18n.md +64 -28
  95. data/guides/source/index.html.erb +1 -1
  96. data/guides/source/initialization.md +155 -58
  97. data/guides/source/kindle/toc.html.erb +1 -1
  98. data/guides/source/layout.html.erb +2 -2
  99. data/guides/source/layouts_and_rendering.md +59 -26
  100. data/guides/source/maintenance_policy.md +3 -3
  101. data/guides/source/migrations.md +101 -62
  102. data/guides/source/nested_model_forms.md +3 -3
  103. data/guides/source/plugins.md +34 -31
  104. data/guides/source/rails_application_templates.md +27 -8
  105. data/guides/source/rails_on_rack.md +41 -58
  106. data/guides/source/routing.md +115 -104
  107. data/guides/source/ruby_on_rails_guides_guidelines.md +2 -2
  108. data/guides/source/security.md +81 -36
  109. data/guides/source/testing.md +56 -79
  110. data/guides/source/upgrading_ruby_on_rails.md +531 -21
  111. data/guides/source/working_with_javascript_in_rails.md +19 -11
  112. metadata +51 -23
  113. data/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
  114. data/guides/assets/images/getting_started/new_post.png +0 -0
  115. data/guides/assets/images/getting_started/post_with_comments.png +0 -0
  116. data/guides/assets/images/getting_started/show_action_for_posts.png +0 -0
  117. data/guides/assets/images/getting_started/template_is_missing_posts_new.png +0 -0
  118. data/guides/assets/images/getting_started/undefined_method_post_path.png +0 -0
  119. data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
  120. data/guides/assets/images/getting_started/unknown_action_new_for_posts.png +0 -0
  121. data/guides/assets/images/jaimeiniesta.jpg +0 -0
  122. data/guides/source/kindle/KINDLE.md +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6f6960a78da480f91ecccaec3fd9a555ea83e7b
4
- data.tar.gz: a0c92a2f2a74a328c9602703c553a9208e545029
3
+ metadata.gz: a161623794a4621a5a9494ab5a7276dc31396e7d
4
+ data.tar.gz: d37862afe12df5f3a83f7403f0dc8f5f4ed88802
5
5
  SHA512:
6
- metadata.gz: ecf7ce48f8a9b9606c734aeb7b68f7364d2b97bdc5145d2af911fdb1cfafe3d6e2f56d6ec783e843bf249a77ff4d14f990bd218a78f08b33e4946f874f893a63
7
- data.tar.gz: dd524fa16bbf1cb9e0392857eb898f5b9babf55897729acf673f4977901f4a81a749e696238eb87e45839507b2aa14408213a5eda5d3dfabcd0a94de0d981bdc
6
+ metadata.gz: 783193071931a97f089e46b314eaaba449563cc341a4426f3d191adcccf023395319dd07c7c0138aee9da9e3c6c5591069b3dc40df05ed08b7b32e0aed09b3aa
7
+ data.tar.gz: a002c2cb1f7b9fd555674ccb759e2ef62e5645bec0a0e57d6fdf2c25a2a19046131cec5723264f8bc5f6a2abe18103bc7bbec79c9444e90cf10d135382c0cf26
data/README.md CHANGED
@@ -8,11 +8,6 @@ pattern.
8
8
  Understanding the MVC pattern is key to understanding Rails. MVC divides your
9
9
  application into three layers, each with a specific responsibility.
10
10
 
11
- The _View layer_ is composed of "templates" that are responsible for providing
12
- appropriate representations of your application's resources. Templates can
13
- come in a variety of formats, but most view templates are HTML with embedded
14
- Ruby code (ERB files).
15
-
16
11
  The _Model layer_ represents your domain model (such as Account, Product,
17
12
  Person, Post, etc.) and encapsulates the business logic that is specific to
18
13
  your application. In Rails, database-backed model classes are derived from
@@ -24,16 +19,26 @@ as provided by the Active Model module. You can read more about Active Record
24
19
  in its [README](activerecord/README.rdoc).
25
20
 
26
21
  The _Controller layer_ is responsible for handling incoming HTTP requests and
27
- providing a suitable response. Usually this means returning HTML, but Rails
28
- controllers can also generate XML, JSON, PDFs, mobile-specific views, and
29
- more. Controllers manipulate models and render view templates in order to
30
- generate the appropriate HTTP response.
22
+ providing a suitable response. Usually this means returning HTML, but Rails controllers
23
+ can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
24
+ manipulate models, and render view templates in order to generate the appropriate HTTP response.
25
+ In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
26
+ controller classes are derived from `ActionController::Base`. Action Dispatch and Action Controller
27
+ are bundled together in Action Pack. You can read more about Action Pack in its
28
+ [README](actionpack/README.rdoc).
29
+
30
+ The _View layer_ is composed of "templates" that are responsible for providing
31
+ appropriate representations of your application's resources. Templates can
32
+ come in a variety of formats, but most view templates are HTML with embedded
33
+ Ruby code (ERB files). Views are typically rendered to generate a controller response,
34
+ or to generate the body of an email. In Rails, View generation is handled by Action View.
35
+ You can read more about Action View in its [README](actionview/README.rdoc).
31
36
 
32
- In Rails, the Controller and View layers are handled together by Action Pack.
33
- These two layers are bundled in a single package due to their heavy interdependence.
34
- This is unlike the relationship between Active Record and Action Pack, which are
35
- independent. Each of these packages can be used independently outside of Rails. You
36
- can read more about Action Pack in its [README](actionpack/README.rdoc).
37
+ Active Record, Action Pack, and Action View can each be used independently outside Rails.
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.
37
42
 
38
43
  ## Getting Started
39
44
 
@@ -54,7 +59,8 @@ can read more about Action Pack in its [README](actionpack/README.rdoc).
54
59
 
55
60
  Run with `--help` or `-h` for options.
56
61
 
57
- 4. Go to http://localhost:3000 and you'll see: "Welcome aboard: You're riding Ruby on Rails!"
62
+ 4. Using a browser, go to `http://localhost:3000` and you'll see:
63
+ "Welcome aboard: You're riding Ruby on Rails!"
58
64
 
59
65
  5. Follow the guidelines to start developing your application. You may find
60
66
  the following resources handy:
@@ -70,8 +76,7 @@ We encourage you to contribute to Ruby on Rails! Please check out the
70
76
 
71
77
  ## Code Status
72
78
 
73
- * [![Build Status](https://api.travis-ci.org/rails/rails.png)](https://travis-ci.org/rails/rails)
74
- * [![Dependencies](https://gemnasium.com/rails/rails.png?travis)](https://gemnasium.com/rails/rails)
79
+ * [![Build Status](https://travis-ci.org/rails/rails.png?branch=master)](https://travis-ci.org/rails/rails)
75
80
 
76
81
  ## License
77
82
 
data/guides/CHANGELOG.md CHANGED
@@ -1,82 +1,116 @@
1
- ## Rails 4.0.13 (January 6, 2015) ##
1
+ ## Rails 4.1.16 (July 12, 2016) ##
2
2
 
3
- *No changes*
3
+ * No changes.
4
4
 
5
5
 
6
- ## Rails 4.0.12 (November 16, 2014) ##
6
+ ## Rails 4.1.15 (March 07, 2016) ##
7
7
 
8
- *No changes*
8
+ * No changes.
9
9
 
10
10
 
11
- ## Rails 4.0.11.1 (November 19, 2014) ##
11
+ ## Rails 4.1.14.2 (February 26, 2016) ##
12
12
 
13
- *No changes*
13
+ * No changes.
14
14
 
15
15
 
16
- ## Rails 4.0.11 (September 11, 2014) ##
16
+ ## Rails 4.1.14.1 (January 25, 2015) ##
17
17
 
18
- *No changes*
18
+ * No changes.
19
19
 
20
20
 
21
- ## Rails 4.0.10 (September 11, 2014) ##
21
+ ## Rails 4.1.14 (November 12, 2015) ##
22
22
 
23
- *No changes*
23
+ * No changes.
24
24
 
25
25
 
26
- ## Rails 4.0.9 (August 18, 2014) ##
26
+ ## Rails 4.1.13 (August 24, 2015) ##
27
27
 
28
- *No changes*
28
+ * No changes.
29
29
 
30
30
 
31
- ## Rails 4.0.8 (July 2, 2014) ##
31
+ ## Rails 4.1.12 (June 25, 2015) ##
32
32
 
33
- *No changes*
33
+ * No changes.
34
34
 
35
35
 
36
- ## Rails 4.0.7 (July 2, 2014) ##
36
+ ## Rails 4.1.11 (June 16, 2015) ##
37
37
 
38
- *No changes*
38
+ * No changes.
39
39
 
40
40
 
41
- ## Rails 4.0.6 (June 26, 2014) ##
41
+ ## Rails 4.1.10 (March 19, 2015) ##
42
42
 
43
- *No changes*
43
+ * No changes.
44
44
 
45
45
 
46
- ## Rails 4.0.5 (May 6, 2014) ##
46
+ ## Rails 4.1.9 (January 6, 2015) ##
47
47
 
48
- *No changes*
48
+ * No changes.
49
49
 
50
50
 
51
- ## Rails 4.0.4 (March 14, 2014) ##
51
+ ## Rails 4.1.8 (November 16, 2014) ##
52
52
 
53
- *No changes*
53
+ * No changes.
54
54
 
55
55
 
56
- ## Rails 4.0.3 (February 18, 2014) ##
56
+ ## Rails 4.1.7.1 (November 19, 2014) ##
57
57
 
58
- *No changes*
58
+ * No changes.
59
59
 
60
60
 
61
- ## Rails 4.0.2 (December 02, 2013) ##
61
+ ## Rails 4.1.7 (October 29, 2014) ##
62
62
 
63
- *No changes*
63
+ * No changes.
64
64
 
65
65
 
66
- ## Rails 4.0.1 (November 01, 2013) ##
66
+ ## Rails 4.1.6 (September 11, 2014) ##
67
67
 
68
- * Added the Rails maintenance policy to the guides.
68
+ * No changes.
69
+
70
+
71
+ ## Rails 4.1.5 (August 18, 2014) ##
72
+
73
+ * No changes.
74
+
75
+
76
+ ## Rails 4.1.4 (July 2, 2014) ##
77
+
78
+ * No changes.
79
+
80
+
81
+ ## Rails 4.1.3 (July 2, 2014) ##
82
+
83
+ * No changes.
84
+
85
+
86
+ ## Rails 4.1.2 (June 26, 2014) ##
87
+
88
+ * Update all Rails 4.1.0 references to 4.1.1 within the guides and code.
89
+
90
+ *John Kelly Ferguson*
91
+
92
+ * Updates the maintenance policy to match the latest versions of Rails.
69
93
 
70
94
  *Matias Korhonen*
71
95
 
72
- ## Rails 4.0.0 (June 25, 2013) ##
73
96
 
74
- * Change Service pages(404, etc). *Stanislav Sobolev*
97
+ ## Rails 4.1.1 (May 6, 2014) ##
98
+
99
+ * No changes.
100
+
101
+
102
+ ## Rails 4.1.0 (April 8, 2014) ##
75
103
 
76
- * Split Validations and Callbacks guide into two. *Steve Klabnik*
104
+ * Fixed missing line and shadow on service pages(404, 422, 500).
77
105
 
78
- * New guide _Working with JavaScript in Rails_. *Steve Klabnik*
106
+ *Dmitry Korotkov*
79
107
 
80
- * Guides updated to reflect new test locations. *Mike Moore*
108
+ * Removed repetitive th tags. Instead of them added one th tag with a colspan attribute.
109
+
110
+ *Sıtkı Bağdat*
111
+
112
+ * Added the Rails maintenance policy to the guides.
113
+
114
+ *Matias Korhonen*
81
115
 
82
- * Guides have a responsive design. *Joe Fiorini*
116
+ Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/guides/CHANGELOG.md) for previous changes.
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook
2
2
  icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency
3
- from the Jimmac icons to get round MS IE and FOP PNG incompatibilies.
3
+ from the Jimmac icons to get round MS IE and FOP PNG incompatibilities.
4
4
 
5
5
  Stuart Rackham
Binary file
Binary file
Binary file
Binary file
@@ -1,57 +1,53 @@
1
- function guideMenu(){
2
- if (document.getElementById('guides').style.display == "none") {
3
- document.getElementById('guides').style.display = "block";
4
- } else {
5
- document.getElementById('guides').style.display = "none";
6
- }
7
- }
8
-
9
- $.fn.selectGuide = function(guide){
1
+ $.fn.selectGuide = function(guide) {
10
2
  $("select", this).val(guide);
11
- }
3
+ };
12
4
 
13
- guidesIndex = {
14
- bind: function(){
5
+ var guidesIndex = {
6
+ bind: function() {
15
7
  var currentGuidePath = window.location.pathname;
16
8
  var currentGuide = currentGuidePath.substring(currentGuidePath.lastIndexOf("/")+1);
17
9
  $(".guides-index-small").
18
10
  on("change", "select", guidesIndex.navigate).
19
11
  selectGuide(currentGuide);
20
- $(".more-info-button:visible").click(function(e){
12
+ $(document).on("click", ".more-info-button", function(e){
21
13
  e.stopPropagation();
22
- if($(".more-info-links").is(":visible")){
14
+ if ($(".more-info-links").is(":visible")) {
23
15
  $(".more-info-links").addClass("s-hidden").unwrap();
24
16
  } else {
25
17
  $(".more-info-links").wrap("<div class='more-info-container'></div>").removeClass("s-hidden");
26
18
  }
27
- $(document).on("click", function(e){
28
- var $button = $(".more-info-button");
29
- var element;
19
+ });
20
+ $("#guidesMenu").on("click", function(e) {
21
+ $("#guides").toggle();
22
+ return false;
23
+ });
24
+ $(document).on("click", function(e){
25
+ e.stopPropagation();
26
+ var $button = $(".more-info-button");
27
+ var element;
30
28
 
31
- // Cross browser find the element that had the event
32
- if (e.target) element = e.target;
33
- else if (e.srcElement) element = e.srcElement;
29
+ // Cross browser find the element that had the event
30
+ if (e.target) element = e.target;
31
+ else if (e.srcElement) element = e.srcElement;
34
32
 
35
- // Defeat the older Safari bug:
36
- // http://www.quirksmode.org/js/events_properties.html
37
- if (element.nodeType == 3) element = element.parentNode;
33
+ // Defeat the older Safari bug:
34
+ // http://www.quirksmode.org/js/events_properties.html
35
+ if (element.nodeType === 3) element = element.parentNode;
38
36
 
39
- var $element = $(element);
37
+ var $element = $(element);
40
38
 
41
- var $container = $element.parents(".more-info-container");
39
+ var $container = $element.parents(".more-info-container");
42
40
 
43
- // We've captured a click outside the popup
44
- if($container.length == 0){
45
- $container = $button.next(".more-info-container");
46
- $container.find(".more-info-links").addClass("s-hidden").unwrap();
47
- $(document).off("click");
48
- }
49
- });
41
+ // We've captured a click outside the popup
42
+ if($container.length === 0){
43
+ $container = $button.next(".more-info-container");
44
+ $container.find(".more-info-links").addClass("s-hidden").unwrap();
45
+ }
50
46
  });
51
47
  },
52
48
  navigate: function(e){
53
49
  var $list = $(e.target);
54
- url = $list.val();
50
+ var url = $list.val();
55
51
  window.location = url;
56
52
  }
57
- }
53
+ };
@@ -129,6 +129,7 @@ body {
129
129
  font-family: Helvetica, Arial, Sans-Serif;
130
130
  text-decoration: none;
131
131
  vertical-align: middle;
132
+ cursor: pointer;
132
133
  }
133
134
  .red-button:active {
134
135
  border-top: none;
@@ -244,7 +245,7 @@ body {
244
245
  #subCol {
245
246
  position: absolute;
246
247
  z-index: 0;
247
- top: 0;
248
+ top: 21px;
248
249
  right: 0;
249
250
  background: #FFF;
250
251
  padding: 1em 1.5em 1em 1.25em;
@@ -36,7 +36,7 @@ hr {
36
36
  }
37
37
 
38
38
  h1,h2,h3,h4,h5,h6 { font-family: "Helvetica Neue", Arial, "Lucida Grande", sans-serif; }
39
- code { font:.9em "Courier New", Monaco, Courier, monospace; }
39
+ code { font:.9em "Courier New", Monaco, Courier, monospace; display:inline}
40
40
 
41
41
  img { float:left; margin:1.5em 1.5em 1.5em 0; }
42
42
  a img { border:none; }
@@ -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
@@ -19,6 +19,8 @@ class TestApp < Rails::Application
19
19
  end
20
20
 
21
21
  class TestController < ActionController::Base
22
+ include Rails.application.routes.url_helpers
23
+
22
24
  def index
23
25
  render text: 'Home'
24
26
  end
@@ -27,7 +29,10 @@ end
27
29
  require 'minitest/autorun'
28
30
  require 'rack/test'
29
31
 
30
- class BugTest < MiniTest::Unit::TestCase
32
+ # Ensure backward compatibility with Minitest 4
33
+ Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
34
+
35
+ class BugTest < Minitest::Test
31
36
  include Rack::Test::Methods
32
37
 
33
38
  def test_returns_success
@@ -39,4 +44,4 @@ class BugTest < MiniTest::Unit::TestCase
39
44
  def app
40
45
  Rails.application
41
46
  end
42
- end
47
+ end
@@ -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
@@ -28,6 +28,8 @@ class TestApp < Rails::Application
28
28
  end
29
29
 
30
30
  class TestController < ActionController::Base
31
+ include Rails.application.routes.url_helpers
32
+
31
33
  def index
32
34
  render text: 'Home'
33
35
  end
@@ -1,9 +1,12 @@
1
1
  # Activate the gem you are reporting the issue against.
2
- gem 'activerecord', '3.2.13'
2
+ gem 'activerecord', '4.0.0'
3
3
  require 'active_record'
4
4
  require 'minitest/autorun'
5
5
  require 'logger'
6
6
 
7
+ # Ensure backward compatibility with Minitest 4
8
+ Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
9
+
7
10
  # This connection will do for database-independent bug reports.
8
11
  ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
9
12
  ActiveRecord::Base.logger = Logger.new(STDOUT)
@@ -25,7 +28,7 @@ class Comment < ActiveRecord::Base
25
28
  belongs_to :post
26
29
  end
27
30
 
28
- class BugTest < MiniTest::Unit::TestCase
31
+ class BugTest < Minitest::Test
29
32
  def test_association_stuff
30
33
  post = Post.create!
31
34
  post.comments << Comment.create!
@@ -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
  gem 'sqlite3'
6
7
  GEMFILE
7
8
 
@@ -36,7 +37,7 @@ class Comment < ActiveRecord::Base
36
37
  belongs_to :post
37
38
  end
38
39
 
39
- class BugTest < MiniTest::Unit::TestCase
40
+ class BugTest < Minitest::Test
40
41
  def test_association_stuff
41
42
  post = Post.create!
42
43
  post.comments << Comment.create!
@@ -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
@@ -1,43 +1,40 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '4.0.0'
4
3
 
5
- # Use sqlite3 as the database for Active Record
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.1'
6
+ # Use SQLite3 as the database for Active Record
6
7
  gem 'sqlite3'
7
-
8
8
  # Use SCSS for stylesheets
9
- gem 'sass-rails'
10
-
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
11
12
  # Use CoffeeScript for .js.coffee assets and views
12
- gem 'coffee-rails'
13
-
13
+ gem 'coffee-rails', '~> 4.0.0'
14
14
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
- # gem 'therubyracer', platforms: :ruby
16
-
17
- # Use Uglifier as compressor for JavaScript assets
18
- gem 'uglifier', '>= 1.0.3'
15
+ # gem 'therubyracer', platforms: :ruby
19
16
 
17
+ # Use jquery as the JavaScript library
20
18
  gem 'jquery-rails'
21
-
22
19
  # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
23
20
  gem 'turbolinks'
24
-
25
- group :doc do
26
- # bundle exec rake doc:rails generates the API under doc/api.
27
- gem 'sdoc', require: false
28
- end
29
-
30
21
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
31
- gem 'jbuilder', '~> 1.2'
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
32
25
 
33
- # To use ActiveModel has_secure_password
26
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
27
+ gem 'spring', group: :development
28
+
29
+ # Use ActiveModel has_secure_password
34
30
  # gem 'bcrypt', '~> 3.1.7'
35
31
 
36
32
  # Use unicorn as the app server
37
33
  # gem 'unicorn'
38
34
 
39
- # Deploy with Capistrano
40
- # gem 'capistrano', group: :development
35
+ # Use Capistrano for deployment
36
+ # gem 'capistrano-rails', group: :development
37
+
38
+ # Use debugger
39
+ # gem 'debugger', group: [:development, :test]
41
40
 
42
- # To use debugger
43
- # gem 'debugger'