Commit Graph

58893 Commits

Author SHA1 Message Date
Kazuhiro NISHIYAMA
bd6d2ec604 Fix broken link 2016-07-15 21:31:33 +09:00
प्रथमेश Sonpatki
ea007832ec Merge pull request #25844 from tyamagu2/empty_typo
[ci skip] fix a typo
2016-07-15 16:32:39 +05:30
Yamaguchi.Tomoki
68d35960f3 [ci skip] fix a typo 2016-07-15 19:43:58 +09:00
Vipul A M
62514c5db7 Merge pull request #25831 from rbr/patch-1
Fix display of unsorted list in release notes of 5.0 [ci skip]
2016-07-14 11:40:31 -07:00
Aaron Patterson
b866be1680 Merge pull request #25816 from greysteil/check-path-param-encoding
Check `request.path_parameters` encoding at the point they're set
2016-07-14 10:40:58 -07:00
Grey Baker
9f38a3fb0c Check request.path_parameters encoding at the point they're set
Check for any non-UTF8 characters in path parameters at the point they're
set in `env`. Previously they were checked for when used to get a controller
class, but this meant routes that went directly to a Rack app, or skipped
controller instantiation for some other reason, had to defend against
non-UTF8 characters themselves.
2016-07-14 16:50:49 +01:00
Grey Baker
60ff98184e Add newline between each migration in structure.sql
Keeps schema migration inserts as a single commit, so we still get all of the
benefits of 42dd2336b3,
but allows for easier git diff-ing. Fixes #25504.
2016-07-14 16:49:03 +01:00
rbr
2f6832e2a2 Fix display of unsorted list in release notes of 5.0 [ci skip] 2016-07-14 16:56:13 +02:00
Claudio B
ea31bdd7c8 Merge pull request #25829 from geshafer/fix-typo-in-mailer-previews-test
Fix typo in mailer previews test description [ci skip]
2016-07-14 07:38:41 -07:00
Gale Shafer
c05127c2fc Fix typo in mailer previews test description [ci skip]
A mailer preview test description misspelled the word configuration.
This commit updates the test description to spell the word correctly.
2016-07-14 10:18:30 -04:00
Javan Makhmali
dbd3b0bfb3 Eliminate extra template lookup in ActionView::Digestor 2016-07-14 09:14:37 -04:00
Xavier Noria
df6684458b fixes a link in the release notes of 5.0 [ci skip] 2016-07-14 12:17:21 +02:00
Xavier Noria
5494af0c0f small reword [ci skip] 2016-07-14 09:42:10 +02:00
Xavier Noria
07d3b588df finders guide: updates the section about batch processing [ci skip]
There are several edits here, but in particular it updates the
guide to reflect 451437c.
2016-07-14 09:40:31 +02:00
Matthew Draper
a1ac08c2d9 Merge pull request #25798 from greysteil/dont-raise-unknown-http-method-low-in-stack
Don't raise ActionController::UnknownHttpMethod from ActionDispatch::Static
2016-07-14 10:41:02 +09:30
Rafael França
853a041d5e Merge pull request #25817 from javan/fix-namespaced-implicit-render-etag-template-digest
Fix adding implicitly rendered namespaced template digests to ETags
2016-07-13 18:19:07 -03:00
Kasper Timm Hansen
85925931fb Merge pull request #25771 from kaspth/make-test-response-assign-response-parser
Let TestResponse assign a parser.
2016-07-13 21:22:19 +02:00
Javan Makhmali
03efd177a1 Fix adding implicitly rendered namespaced template digests to ETags 2016-07-13 15:07:49 -04:00
Xavier Noria
2bf36970a0 removes a unnecessary limit call
We are setting a limit unconditionally just below,
which overrides any existing one anyway.
2016-07-13 20:55:37 +02:00
oss92
b937c24edc Added :fallback_string option to Array#to_sentence 2016-07-13 20:19:26 +02:00
Grey Baker
25c1461766 Don't raise ActionController::UnknownHttpMethod from ActionDispatch::Static
The `ActionDispatch::Static` middleware is used low down in the stack to serve
static assets before doing much processing. Since it's called from so low in
the stack, we don't have access to the request ID at this point, and generally
won't have any exception handling defined (by default `ShowExceptions` is added
to the stack quite a bit higher and relies on logging and request ID).

Before 8f27d6036a
this middleware would ignore unknown HTTP methods, and an exception about these
would be raised higher in the stack. After that commit, however, that exception
will be raised here.

If we want to keep `ActionDispatch::Static` so low in the stack (I think we do)
we should suppress the `ActionController::UnknownHttpMethod` exception here,
and instead let it be raised higher up the stack, once we've had a chance to
define exception handling behaviour.

This PR updates `ActionDispatch::Static` so it passes `Rack::Request` objects to
`ActionDispatch::FileHandler`, which won't raise an
`ActionController::UnknownHttpMethod` error. If an unknown method is
passed, it should exception higher in the stack instead, once we've had a
chance to define exception handling behaviour.`
2016-07-13 17:52:36 +01:00
Xavier Noria
451437c6f5 adds support for limits in batch processing 2016-07-13 18:23:13 +02:00
Matthew Draper
3b55ac22c9 Merge pull request #25799 from greysteil/wrap-rack-params-exceptions
Handle `Rack::QueryParser` errors in `ActionDispatch::ExceptionWrapper`
2016-07-14 00:58:30 +09:30
Guillermo Iguaran
3e18af6916 Merge pull request #25795 from mechanicles/command-importance
Give importance to rails command [ci skip]
2016-07-13 09:16:04 -05:00
Santosh Wadghule
e73b5cf51b Give importance to rails command in the comment section. 2016-07-13 19:13:05 +05:30
Vipul A M
e1915e712d Merge pull request #25748 from CodingItWrong/generator-field-types-link
Correct link for model generator field types
2016-07-13 01:18:12 -07:00
Josh Justice
5ae7fc5e40 Correct link for model generator field types
The most complete list of field types appears in the `SchemaStatements` docs rather than the `TableDefinition` docs.

The change to link to `SchemaStatements` means that the explanation for the `index` parameter is no longer available on the linked-to page. A brief explanation of the `index` parameter is added directly in the guide to make up for this.
2016-07-13 04:15:04 -04:00
Jeremy Wadsack
31a8588a01 Create connection.active_record notification and use that to ensure that lazy-
loaded model classes have their connections wrapped in transactions.

See #17776

In Rails 4 config.eager_load was changed to false in the test environment. This
means that model classes that connect to alternate databases with
establish_connection are not loaded at start up. If use_transactional_fixtures
is enabled, transactions are wrapped around the connections that have been
established only at the start of the test suite. So model classes loaded later
don't have transactions causing data created in the alternate database not to
be removed.

This change resolves that by creating a new connection.active_record
notification that gets fired whenever a connection is established. I then added
a subscriber after we set up transactions in the test environment to listen for
additional connections and wrap those in transactions as well.
2016-07-12 23:35:29 -07:00
Rafael França
9be45aceba Merge pull request #25790 from mrageh/wrap-lazy-load-hooks-in-module
Wrap module around lazy load hooks
2016-07-13 01:57:54 -03:00
Rafael Mendonça França
fc50f1fd50
Remove old test that check duplicated items in the load path
This test was added to protect the test suite from our mistakes but now
it is failing because bundler does add duplicated libs in the load path
by design (if the repository has more than one gem)
2016-07-13 01:54:42 -03:00
Grey Baker
fe859a5421 Handle Rack::QueryParser errors in ActionDispatch::ExceptionWrapper
Rack [recently](7e7a389044)
moved the namespace of its `ParameterTypeError` and `InvalidParameterError`
errors. Whilst an alias for the old name was added, the logic in
`ActionDispatch::ExceptionWrapper` was still broken by this change, since it
relies on the class name.

This PR updates `ActionDispatch::ExceptionWrapper` to handle the Rack 2.0
namespaced errors correctly. We no longer need to worry about the old names,
since Rails specifies Rack ~> 2.0.
2016-07-12 16:41:09 +01:00
Akira Matsuda
0796d14211 Missing require 'active_support/multibyte/unicode' 2016-07-12 22:34:11 +09:00
Vipul A M
86952b2ff2 Merge pull request #25797 from kei-s/migrations_links
[ci skip] Update redirecting links in guides
2016-07-12 04:23:24 -07:00
kei-s
fe5c9fb76e [ci skip] Update redirecting links in guides 2016-07-12 20:12:24 +09:00
Xavier Noria
de1227a547 Merge pull request #25690 from robin850/speed-up-rdoc
Speed up RDoc generation when it's already been done once
2016-07-12 09:05:17 +02:00
Rafael França
3df3d80ade Merge pull request #25794 from mechanicles/rails-to-Rails
rails -> Rails [ci skip]
2016-07-12 03:58:17 -03:00
Santosh Wadghule
d8575289a2 rails -> Rails [ci skip] 2016-07-12 12:21:36 +05:30
Rafael França
2afd5e78b8 Merge pull request #25793 from jmondo/strptime
Raise ArgumentError for bad strptime arguments
2016-07-12 03:07:22 -03:00
John Gesimondo
424e961be7 Raise ArgumentError for bad strptime arguments 2016-07-11 20:49:21 -07:00
mrageh
949485550f
Wrap module around lazy load hooks
Fix for issue https://github.com/rails/rails/issues/25784

Prior to this commit the lazy_load_hooks.rb file contained important lazy load
hooks. Since [7c90d91](7c90d91c3c) the [documentation](http://api.rubyonrails.org/files/activesupport/lib/active_support/lazy_load_hooks_rb.html) did not display
the comments in this file as the docs for load hooks.

This commit wraps the code within this file in a module so we can display the
documentation for `ActiveSupport` load hooks. By extending `ActiveSupport` with
this module, all the methods within it should still be accessible through
`ActiveSupport`.
2016-07-12 02:44:50 +01:00
Matthew Draper
108a407b7d Merge pull request #25792 from prathamesh-sonpatki/test-typo
Remove duplicate test and fix a typo in the test
2016-07-12 11:09:17 +09:30
Prathamesh Sonpatki
3e43edd5ae
Remove duplicate test and fix a typo in the test
- Tests for dup'ing params was separately added in a separate file in
  https://github.com/rails/rails/pull/25735.
2016-07-12 06:44:02 +05:30
Matthew Draper
e6352dbbb5 Merge pull request #25735 from timrogers/actioncontroller-parameters-dup
Stop changes to a dupped `ActionController::Parameters` mutating the original
2016-07-12 05:54:26 +09:30
Paul Sadauskas
629dde297c AS::Duration should serialize empty values correctly. (#25656)
The current implementation serializes zero-length durations incorrectly (it serializes as `"-P"`), and cannot un-serialize itself:

```
[1] pry(main)> ActiveSupport::Duration.parse(0.minutes.iso8601)
ActiveSupport::Duration::ISO8601Parser::ParsingError: Invalid ISO 8601 duration: "-P" is empty duration
from /Users/rando/.gem/ruby/2.3.1/gems/activesupport-5.0.0/lib/active_support/duration/iso8601_parser.rb:96:in `raise_parsing_error'
```

Postgres empty intervals are serialized as `"PT0S"`, which is also parseable by the Duration deserializer, so I've modified the `ISO8601Serializer` to do the same.

Additionally, the `#normalize` function returned a negative sign if `parts` was blank (all zero). Even though this fix does not rely on the sign, I've gone ahead and corrected that, too, in case a future refactoring of `#serialize` uses it.
2016-07-11 15:45:04 -04:00
Rafael França
f3cd032a2c Merge pull request #25782 from kamipo/fix_test_failure
Fix Active Record test failure
2016-07-11 14:31:24 -03:00
Ryuta Kamizono
b10b7917e6 Fix Active Record test failure
Caused at a45363a2fb53e0a016f33dd211c00b5d81764379.
2016-07-12 01:43:37 +09:00
Joseph Mullins
931781b74f Update ActionCable Rebroadcasting a Message documentation
Replace broadcast_to with ActionCable.server.broadcast to be inline with its partner, #stream_from
2016-07-12 01:24:15 +09:30
Sean Griffin
968b59af87 Merge pull request #25575 from taboularasa/taboularasa/update-docs-ActiveModel__Type__Boolean
[ci skip] add class level documentation to ActiveModel::Type::Boolean
2016-07-11 11:02:23 -04:00
Sean Griffin
a45363a2fb Always prefer class types to query types when casting group
When `group` is used in combination with any calculation method, the
resulting hash uses the grouping expression as the key. Currently we're
incorrectly always favoring the type reported by the query, instead of
the type known by the class. This causes differing behavior depending on
whether the adaptor actually gives proper types with the query or not.
After this change, the behavior will be the same on all adaptors -- we
see if we know the type from the class, fall back to the type from the
query, and finally fall back to the identity type.

Fixes #25595
2016-07-11 10:57:37 -04:00
David Elliott
3691c751e9 [ci skip] add class level documentation to ActiveModel::Type::Boolean
add documentation of the behaviors of type coercion at the class level
2016-07-11 07:29:58 -07:00