Commit Graph

58893 Commits

Author SHA1 Message Date
Jun Aruga
acf99bde03 Remove unused activerecord requirement in actionpack. 2016-07-11 16:06:37 +02:00
Robin Dupret
9e99649e7e Speed up RDoc generation when it's already been done once
Only include files that contain changes since the last generation
of the API documentation.

Thus, only modified files are re-generated instead of the whole API.

The `created.rid` file won't contain the whole list of files anymore
if we generate several times the API but we don't really care about it,
only the generation date and time is important.

It is possible to fall back to the previous behavior by defining the ALL
environment variable running the `rake rdoc` task.
2016-07-11 15:50:27 +02:00
प्रथमेश Sonpatki
79bc06647c Merge pull request #25773 from jmondo/patch-2
Update class_attribute docs
2016-07-11 09:33:24 +05:30
John Gesimondo
39d84608ad Update class_attribute docs 2016-07-10 19:04:18 -07:00
Kasper Timm Hansen
333670ceb9 Let TestResponse assign a parser.
Previously we'd only assign a response parser when a request came through
Action Dispatch integration tests. This made calls to `parsed_body` when a TestResponse
was manually instantiated — though own doing or perhaps from a framework — unintentionally
blow up because no parser was set at that time.

The response can lookup a parser entirely through its own ivars. Extract request encoder to
its own file and assume that a viable content type is present at TestResponse instantiation.

Since the default response parser is a no-op, making `parsed_body` equal to `body`, no
exceptions will be thrown.
2016-07-10 22:02:12 +02:00
Guillermo Iguaran
db1582ac34 Merge pull request #25757 from monkey-mas/add-tests-for-response_test
Add tests for 1xx, 204 and 304 responses to response_test.rb
2016-07-10 13:45:59 -05:00
Guillermo Iguaran
27a07165d5 Merge pull request #25769 from y-yagi/remove_unnecessary_send
remove unnecessary send
2016-07-10 13:44:08 -05:00
Vijay Dev
b76808602d Merge branch 'master' of github.com:rails/docrails 2016-07-10 10:58:39 +00:00
yuuji.yaginuma
7568f31650 remove unnecessary send
`class_variable_get` is public from Ruby 1.9.
Ref: http://ruby-doc.org/core-2.2.0/Module.html#method-i-class_variable_get
2016-07-10 16:39:16 +09:00
Rafael França
777ff90ab5 Merge pull request #25759 from prathamesh-sonpatki/changelog-cleanups
Cleanup CHANGELOGs [ci skip]
2016-07-09 21:03:15 -03:00
Rafael França
4ff1c22102 Merge pull request #25766 from vipulnsward/fix-ac-tests-2-4
Fix AJ tests on ruby 2.4 being caused since classes are unified for Integer
2016-07-09 20:59:48 -03:00
Vipul A M
8dd9bb6e9b
Fix AJ tests on ruby 2.4 being causes since classes are unified for Integer, and we create test name nased on arg class. Append ar as well to the test name 2016-07-09 16:24:03 -07:00
Prathamesh Sonpatki
724b0833bd
Cleanup CHANGELOGs [ci skip]
- Cleanup Active Record CHANGELOG.
- Add missing CHANGELOG for https://github.com/rails/rails/pull/25688.
- Clarify that assets requests logging is suppressed.
2016-07-09 18:11:35 +05:30
Masaru Nomura
bddf83bfcf Add tests for 1xx, 204 and 304 responses to response_test.rb
In response_test.rb, we haven't had a test to make sure that

1) these responses don't have a message-body as described in RFC7231[1]

2) 1xx and 204 responses must not have a Content-Length header field
   as described in RFC7230-section3.3.2[2]

[1] https://tools.ietf.org/html/rfc7231
[2] https://tools.ietf.org/html/rfc7230#section-3.3.2

Even though our implementation doesn't allow users to send
a Content-Length header field in a 304 response, sending the
header field is valid as mentioned in RFC7230-section3.3.2[2].
So I've decided not to test whether or not a 304 response has
the header.

The citation from the section is as follows;
```
A server MAY send a Content-Length header field in a 304 (Not
Modified) response to a conditional GET request (Section 4.1 of
[RFC7232]); a server MUST NOT send Content-Length in such a response
unless its field-value equals the decimal number of octets that would
have been sent in the payload body of a 200 (OK) response to the same
request.
```
2016-07-09 19:37:06 +09:00
Matthew Draper
4e961ca184 Merge pull request #23636 from rab/fix-to_param-truncation
fix to_param to maximize content
2016-07-09 07:14:26 +09:30
Rob Biedenharn
3b49d79223 fix to_param to maximize content
The documentation states that parameter values longer than 20 characters
will be truncated by words, but the example shows that a parameter based
on "David Heinemeier Hansson" (with id: 125) becomes "125-david" when
"David Heinemeier".length == 16 so why so short?

The answer lies in the use of the #truncate option omission: nil which
seems to have been intended to mean "nothing", but which actually causes
the default string "..." to be used. This causes #truncate to cleave
words until the "..." can be added and still remain within the requested
size of 20 characters.

The better option is omission: '' (which is probably what was originally
intended).

Furthermore, since the use of #parameterize will remove non-alphanumeric
characters, we can maximize the useful content of the output by calling
parameterize first and then giving truncate a separator: /-/ rather than
a space.
2016-07-08 17:12:14 -04:00
Guillermo Iguaran
c62ac07be8 Merge pull request #25652 from prathamesh-sonpatki/rm-boot-rails
Remove unused boot_rails method and it's usage
2016-07-08 14:50:24 -05:00
Guillermo Iguaran
8e74f71bd1 Merge pull request #25688 from mahnunchik/host-env-var
Use the HOST environment variable for rails server #25677
2016-07-08 13:02:45 -05:00
Matthew Draper
48e8056d4f Correct changelog layout
[ci skip]
2016-07-09 03:17:51 +09:30
Matthew Draper
e995611155 Insert changelog entry for #25615 2016-07-09 02:56:03 +09:30
Matthew Draper
92421ee2d2 Merge pull request #25624 from tinco/actioncable_write_race
Fix race condition in websocket stream write
2016-07-09 02:44:15 +09:30
Tim Rogers
9607059569 Trust Object#dup in ActionController::Parameters, using #initialize_copy to manually duplicate the underlying parameters hash
It looks like `ActionController::Parameters#dup` is leftover from when the class inherited from `Hash`. We can just trust `#dup`, which already copies the `@permitted` instance variable (confirmed by tests). We still define a `#initialize_copy` to make `@parameters` a copy that can be mutated without affecting the original instance.
2016-07-08 17:48:25 +01:00
Rafael Mendonça França
9c4c2126b1
Merge pull request #25714 from robin850/changelog-25692
Add a changelog entry for #25692
2016-07-07 23:56:57 -03:00
Vipul A M
7a15e2828e Merge pull request #25745 from alexcameron89/schema_statements
[ci skip] Update documentation in AR SchemaStatements
2016-07-07 19:51:21 -07:00
Alex Kitchens
ffffecac4d [ci skip] Update documentation in AR SchemaStatements
This includes minor grammar fixes throughout the file.
2016-07-07 21:47:32 -05:00
Rafael França
24f04b6657 Merge pull request #25730 from prathamesh-sonpatki/rm-cookie-only
No need to set `cookie_only` option from Rails
2016-07-07 17:33:28 -03:00
Rafael França
267c53a2a3 Merge pull request #25743 from abhishekjain16/small_fix
Fix typo in test case
2016-07-07 17:33:10 -03:00
Abhishek Jain
227cd1dbcf Fix typo in test case 2016-07-08 01:51:46 +05:30
Prathamesh Sonpatki
193ad87b34
Add a test case for verifying cookie_only is set even if user tries to set it false 2016-07-07 22:20:40 +05:30
Rafael França
3d716b9e66 Merge pull request #25736 from voxik/file-store-test-require-pathname
Pathname might not be always initialized.
2016-07-07 11:26:21 -03:00
Vít Ondruch
34e0eafb4b Pathname might not be always initialized.
Require 'pathname' explicitly
2016-07-07 12:27:01 +02:00
Tim Rogers
ba3dd5ca04 Changes to a dupped ActionController::Parameters mutate the original
When `ActionController::Parameters` is duplicated with `#dup`, it doesn't create a duplicate of the instance variables (e.g. `@parameters`) but rather maintains the reference (see <http://ruby-doc.org/core-2.3.1/Object.html>). Given that the parameters object is often manipulated as if it were a hash (e.g. with `#delete` and similar methods), this leads to unexpected behaviour, like the following:

```
params = ActionController::Parameters.new(foo: "bar")
duplicated_params = params.dup
duplicated_params.delete(:foo)

params == duplicated_params
```

This fixes the bug by defining a private `#initialize_copy` method, used internally by `#dup`, which makes a copy of `@parameters`.
2016-07-07 10:48:13 +01:00
Yves Senn
19ff64d8f4 Merge pull request #25731 from chen7897499/fix_typo
Fix typo: caches_pages to caches_page. [ci skip]
2016-07-07 08:39:30 +02:00
chen7897499
e3392642b8 Fix typo: caches_pages to caches_page.
Fix a small typo on doc: "caches_pages" -> "caches_page".
2016-07-07 14:34:31 +08:00
Rafael França
e4edddede3 Merge pull request #25691 from y-yagi/test_with_latest_rescue
test with latest resque
2016-07-07 02:23:41 -03:00
Matthew Draper
aeba05d389 Merge pull request #25707 from matthewd/double-reap
Don't reap connections that have already been reassigned
2016-07-07 07:40:26 +09:30
Matthew Draper
d5ca0a8b8e Merge pull request #25726 from Gaurav2728/update_doc_for_require_relative
updating doc for prefer require_relative [ci skip]
2016-07-07 07:11:56 +09:30
Gaurav Sharma
ef4972a338 update doc for prefer require_relative over require + File.expand_path [ci skip] 2016-07-07 01:54:57 +05:30
प्रथमेश Sonpatki
478077bf4a Merge pull request #25720 from timrogers/actiondispatch-ssl-defaults-docs
Correct defaults in documentation for ActionDispatch::SSL
2016-07-06 21:50:03 +05:30
Tim Rogers
8a12c7c2f5 [ci skip] Correct defaults in documentation for ActionDispatch::SSL
`config.ssl_options` permits configuring various options for the middleware. Default options for HSTS (specified with the `:hsts` key in the options hash) are specified in `.default_hsts_options`. The documentation did not make clear these defaults, and in one case was wrong.
2016-07-06 17:01:23 +01:00
प्रथमेश Sonpatki
6038a548fd Merge pull request #25717 from alexcameron89/connection_pool_doc
[ci skip] Update ConnectionPool documentation for readability purposes
2016-07-06 20:08:41 +05:30
Alex Kitchens
1a27718b93 [ci skip] Update ConnectionPool documentation for readability 2016-07-06 09:30:29 -05:00
Matthew Draper
61f4b1ff8a Make connection stealing more explicit 2016-07-06 23:50:37 +09:30
प्रथमेश Sonpatki
f8bd5827d1 Merge pull request #25716 from willnet/remove-rails-4
[ci skip] Remove reference to Rails 4 in the initialization guide.
2016-07-06 19:43:20 +05:30
willnet
9da3720ba9 [ci skip] Remove reference to Rails 4 in the initialization guide.
Following commit removed reference to rails 4, but there is one left.

a9f50f87c3
2016-07-06 22:57:24 +09:00
Robin Dupret
e2b21620e9 Add a changelog entry for #25692 [ci skip] 2016-07-06 14:38:48 +02:00
Santiago Pastorino
3a62dacd71 Merge pull request #25708 from maclover7/jm-master-bugreports
Bump version for master bug report templates
2016-07-06 08:57:34 -03:00
प्रथमेश Sonpatki
69cd8fe94a Merge pull request #25710 from y-yagi/follow_up_to_24436
remove `-t` option from default sendmail arguments [ci skip]
2016-07-06 16:25:02 +05:30
yuuji.yaginuma
2a45296114 remove -t option from default sendmail arguments [ci skip]
Follow up to #24436
2016-07-06 18:57:53 +09:00
Prathamesh Sonpatki
32426cec27
Fix documentation for number_with_precision helper in AV guide [ci skip]
- It accepts `precision` option, not `number_with_precision`.
2016-07-06 10:45:09 +05:30