rails 4.0.13 → 4.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -17
- data/guides/CHANGELOG.md +68 -34
- data/guides/assets/images/edge_badge.png +0 -0
- data/guides/assets/images/feature_tile.gif +0 -0
- data/guides/assets/images/footer_tile.gif +0 -0
- data/guides/assets/images/fxn.png +0 -0
- data/guides/assets/images/getting_started/article_with_comments.png +0 -0
- data/guides/assets/images/getting_started/challenge.png +0 -0
- data/guides/assets/images/getting_started/confirm_dialog.png +0 -0
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
- data/guides/assets/images/getting_started/form_with_errors.png +0 -0
- data/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
- data/guides/assets/images/getting_started/new_article.png +0 -0
- data/guides/assets/images/getting_started/rails_welcome.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
- data/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
- data/guides/assets/images/header_tile.gif +0 -0
- data/guides/assets/images/icons/README +1 -1
- data/guides/assets/images/icons/callouts/11.png +0 -0
- data/guides/assets/images/icons/callouts/12.png +0 -0
- data/guides/assets/images/icons/callouts/13.png +0 -0
- data/guides/assets/images/icons/callouts/15.png +0 -0
- data/guides/assets/images/icons/caution.png +0 -0
- data/guides/assets/images/icons/example.png +0 -0
- data/guides/assets/images/radar.png +0 -0
- data/guides/assets/images/rails4_features.png +0 -0
- data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
- data/guides/assets/images/vijaydev.jpg +0 -0
- data/guides/assets/javascripts/guides.js +30 -34
- data/guides/assets/stylesheets/main.css +2 -1
- data/guides/assets/stylesheets/print.css +1 -1
- data/guides/bug_report_templates/action_controller_gem.rb +9 -4
- data/guides/bug_report_templates/action_controller_master.rb +4 -2
- data/guides/bug_report_templates/active_record_gem.rb +5 -2
- data/guides/bug_report_templates/active_record_master.rb +2 -1
- data/guides/bug_report_templates/generic_gem.rb +15 -0
- data/guides/bug_report_templates/generic_master.rb +26 -0
- data/guides/code/getting_started/Gemfile +21 -24
- data/guides/code/getting_started/Gemfile.lock +78 -73
- data/guides/code/getting_started/Rakefile +1 -1
- data/guides/code/getting_started/app/assets/javascripts/application.js +1 -2
- data/guides/code/getting_started/app/views/layouts/application.html.erb +2 -2
- data/guides/code/getting_started/config/environment.rb +1 -1
- data/guides/code/getting_started/config/environments/development.rb +2 -2
- data/guides/code/getting_started/config/environments/production.rb +3 -3
- data/guides/code/getting_started/config/environments/test.rb +2 -2
- data/guides/code/getting_started/config/initializers/secret_token.rb +1 -1
- data/guides/code/getting_started/config/initializers/session_store.rb +1 -1
- data/guides/code/getting_started/config/routes.rb +1 -1
- data/guides/code/getting_started/config.ru +1 -1
- data/guides/code/getting_started/public/404.html +2 -0
- data/guides/code/getting_started/public/422.html +2 -0
- data/guides/code/getting_started/public/500.html +2 -0
- data/guides/code/getting_started/test/test_helper.rb +0 -3
- data/guides/rails_guides/helpers.rb +3 -1
- data/guides/source/2_2_release_notes.md +2 -2
- data/guides/source/2_3_release_notes.md +8 -8
- data/guides/source/3_0_release_notes.md +2 -3
- data/guides/source/3_1_release_notes.md +2 -2
- data/guides/source/3_2_release_notes.md +12 -12
- data/guides/source/4_0_release_notes.md +79 -46
- data/guides/source/4_1_release_notes.md +731 -0
- data/guides/source/_welcome.html.erb +5 -2
- data/guides/source/action_controller_overview.md +189 -40
- data/guides/source/action_mailer_basics.md +27 -27
- data/guides/source/action_view_overview.md +131 -20
- data/guides/source/active_model_basics.md +6 -6
- data/guides/source/active_record_basics.md +15 -15
- data/guides/source/active_record_callbacks.md +18 -16
- data/guides/source/active_record_querying.md +93 -51
- data/guides/source/active_record_validations.md +26 -24
- data/guides/source/active_support_core_extensions.md +72 -118
- data/guides/source/active_support_instrumentation.md +13 -4
- data/guides/source/api_documentation_guidelines.md +104 -6
- data/guides/source/asset_pipeline.md +573 -244
- data/guides/source/association_basics.md +94 -22
- data/guides/source/caching_with_rails.md +15 -6
- data/guides/source/command_line.md +55 -46
- data/guides/source/configuring.md +248 -52
- data/guides/source/contributing_to_ruby_on_rails.md +18 -17
- data/guides/source/credits.html.erb +2 -2
- data/guides/source/debugging_rails_applications.md +39 -8
- data/guides/source/development_dependencies_install.md +91 -8
- data/guides/source/documents.yaml +4 -0
- data/guides/source/engines.md +678 -232
- data/guides/source/form_helpers.md +53 -35
- data/guides/source/generators.md +19 -15
- data/guides/source/getting_started.md +758 -497
- data/guides/source/i18n.md +64 -28
- data/guides/source/index.html.erb +1 -1
- data/guides/source/initialization.md +155 -58
- data/guides/source/kindle/toc.html.erb +1 -1
- data/guides/source/layout.html.erb +2 -2
- data/guides/source/layouts_and_rendering.md +59 -26
- data/guides/source/maintenance_policy.md +3 -3
- data/guides/source/migrations.md +101 -62
- data/guides/source/nested_model_forms.md +3 -3
- data/guides/source/plugins.md +34 -31
- data/guides/source/rails_application_templates.md +27 -8
- data/guides/source/rails_on_rack.md +41 -58
- data/guides/source/routing.md +115 -104
- data/guides/source/ruby_on_rails_guides_guidelines.md +2 -2
- data/guides/source/security.md +81 -36
- data/guides/source/testing.md +56 -79
- data/guides/source/upgrading_ruby_on_rails.md +531 -21
- data/guides/source/working_with_javascript_in_rails.md +19 -11
- metadata +51 -23
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
- data/guides/assets/images/getting_started/new_post.png +0 -0
- data/guides/assets/images/getting_started/post_with_comments.png +0 -0
- data/guides/assets/images/getting_started/show_action_for_posts.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_posts_new.png +0 -0
- data/guides/assets/images/getting_started/undefined_method_post_path.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_posts.png +0 -0
- data/guides/assets/images/jaimeiniesta.jpg +0 -0
- data/guides/source/kindle/KINDLE.md +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a161623794a4621a5a9494ab5a7276dc31396e7d
|
4
|
+
data.tar.gz: d37862afe12df5f3a83f7403f0dc8f5f4ed88802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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.
|
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://
|
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.
|
1
|
+
## Rails 4.1.16 (July 12, 2016) ##
|
2
2
|
|
3
|
-
*No changes
|
3
|
+
* No changes.
|
4
4
|
|
5
5
|
|
6
|
-
## Rails 4.
|
6
|
+
## Rails 4.1.15 (March 07, 2016) ##
|
7
7
|
|
8
|
-
*No changes
|
8
|
+
* No changes.
|
9
9
|
|
10
10
|
|
11
|
-
## Rails 4.
|
11
|
+
## Rails 4.1.14.2 (February 26, 2016) ##
|
12
12
|
|
13
|
-
*No changes
|
13
|
+
* No changes.
|
14
14
|
|
15
15
|
|
16
|
-
## Rails 4.
|
16
|
+
## Rails 4.1.14.1 (January 25, 2015) ##
|
17
17
|
|
18
|
-
*No changes
|
18
|
+
* No changes.
|
19
19
|
|
20
20
|
|
21
|
-
## Rails 4.
|
21
|
+
## Rails 4.1.14 (November 12, 2015) ##
|
22
22
|
|
23
|
-
*No changes
|
23
|
+
* No changes.
|
24
24
|
|
25
25
|
|
26
|
-
## Rails 4.
|
26
|
+
## Rails 4.1.13 (August 24, 2015) ##
|
27
27
|
|
28
|
-
*No changes
|
28
|
+
* No changes.
|
29
29
|
|
30
30
|
|
31
|
-
## Rails 4.
|
31
|
+
## Rails 4.1.12 (June 25, 2015) ##
|
32
32
|
|
33
|
-
*No changes
|
33
|
+
* No changes.
|
34
34
|
|
35
35
|
|
36
|
-
## Rails 4.
|
36
|
+
## Rails 4.1.11 (June 16, 2015) ##
|
37
37
|
|
38
|
-
*No changes
|
38
|
+
* No changes.
|
39
39
|
|
40
40
|
|
41
|
-
## Rails 4.
|
41
|
+
## Rails 4.1.10 (March 19, 2015) ##
|
42
42
|
|
43
|
-
*No changes
|
43
|
+
* No changes.
|
44
44
|
|
45
45
|
|
46
|
-
## Rails 4.
|
46
|
+
## Rails 4.1.9 (January 6, 2015) ##
|
47
47
|
|
48
|
-
*No changes
|
48
|
+
* No changes.
|
49
49
|
|
50
50
|
|
51
|
-
## Rails 4.
|
51
|
+
## Rails 4.1.8 (November 16, 2014) ##
|
52
52
|
|
53
|
-
*No changes
|
53
|
+
* No changes.
|
54
54
|
|
55
55
|
|
56
|
-
## Rails 4.
|
56
|
+
## Rails 4.1.7.1 (November 19, 2014) ##
|
57
57
|
|
58
|
-
*No changes
|
58
|
+
* No changes.
|
59
59
|
|
60
60
|
|
61
|
-
## Rails 4.
|
61
|
+
## Rails 4.1.7 (October 29, 2014) ##
|
62
62
|
|
63
|
-
*No changes
|
63
|
+
* No changes.
|
64
64
|
|
65
65
|
|
66
|
-
## Rails 4.
|
66
|
+
## Rails 4.1.6 (September 11, 2014) ##
|
67
67
|
|
68
|
-
*
|
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
|
-
|
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
|
-
*
|
104
|
+
* Fixed missing line and shadow on service pages(404, 422, 500).
|
77
105
|
|
78
|
-
*
|
106
|
+
*Dmitry Korotkov*
|
79
107
|
|
80
|
-
*
|
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
|
-
|
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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
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
|
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
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,57 +1,53 @@
|
|
1
|
-
function
|
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
|
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
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
36
|
-
|
37
|
-
|
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
|
-
|
37
|
+
var $element = $(element);
|
40
38
|
|
41
|
-
|
39
|
+
var $container = $element.parents(".more-info-container");
|
42
40
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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:
|
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
|
-
|
11
|
-
|
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
|
-
|
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
|
-
|
20
|
-
|
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', '
|
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 <
|
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 <
|
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
|
-
#
|
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',
|
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', '~>
|
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
|
-
#
|
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
|
-
#
|
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'
|