| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
We sometimes say "✂️ newline after `private`" in a code review (e.g.
https://github.com/rails/rails/pull/18546#discussion_r23188776,
https://github.com/rails/rails/pull/34832#discussion_r244847195).
Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style
`EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059).
That cop and enforced style will reduce the our code review cost.
|
|
|
|
| |
Removed unnecessary semicolons
|
|
|
|
| |
as well
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to avoid overwriting a query parameter with the wrapped
parameters hash. Previously this was implemented by merging the wrapped
parameters at the root level if the key already existed, which was
effectively a no-op. The query parameter was still overwritten in the
filtered parameters hash, however.
We can fix that discrepancy with a simpler implementation and less
unnecessary work by skipping parameter wrapping entirely if the key was
sent as a query parameter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We shouldn't perform parameter wrapping if it would overwrite one of the
parameters sent with the request, as that would interfere with reading
the parameter directly from the top level `params` hash.
The current implementation has logic for this case, but it doesn't
handle `nil`/`false` values, which means these parameters:
{ "user" => nil }
are transformed into this `params` hash:
{ "user" => { "user" => nil } }
and `params["user"]` no longer returns the original parameter value.
|
|
|
|
|
|
|
|
| |
* The method name must be `stored_attributes`, not `stores_attributes`.
* `attribute_names` must return a non-empty value. Because
`stored_attributes` is not checked if `attribute_names` is empty.
Follow up to #28056
|
|
|
|
| |
Modified params wrapper to account for model's stored_attributes
|
|
|
|
|
|
| |
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
|
| |
|
|\
| |
| |
| | |
Don't error on an empty CONTENT_TYPE
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit prevents a possible issue wherein an empty CONTENT_TYPE
header is sent in a request to a Rails application, and then `request.content_mime_type`
would return `nil`. This is because the `has_content_type?` guard method
was not properly checking the validity of a request's content type; it
was only checking to see whether or not the header existed, not whether
it had a value stored inside.
Relatedly, after an internal discussion, it was determined that the
`has_content_type?` method is not meant to be part of the public API,
and is therefore changed to a `:nodoc:` method in this commit.
The test for this behavior is a little bit ugly, for two reasons. One is
that it was difficult to determine where to place the test... I figured
the best place would be with the rest of the ParamsWrapper stuff, since
that's where the original issue was. Also, we have to do some fancy
footwork in calling `dispatch` on the test's controller manually... this
is because `ActionController::TestCase` will throw an error if you try
and pass in a nil content type, which is exactly what we are trying to
test here... Because of that, we have to manually call in to the
controller, and bypass the `post` request helper.
Fixes #26912.
This is a regression in behavior between Rails versions 4.2.x and 5.0.x,
which was introduced via [this commit](https://github.com/rails/rails/commit/a9f28600e901b11a9222e34bfae8642bfb753186).
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
|
|
|
|
|
|
|
| |
Non-kwargs requests are deprecated now.
Guides are updated as well.
`post url, nil, nil, { a: 'b' }` doesn't make sense.
`post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
|
| |
|
| |
|
| |
|
|
|
|
| |
AC::Metal::ParamsWrapper
|
| |
|
|
|
|
| |
specify a role for identifying accessible attributes when wrapping params
|
| |
|
| |
|
| |
|
|
|
|
| |
it doesn't force Action Controller / Active Record to load, but it doesn't fail if they have already loaded. Thanks @josevalim for the hint.
|
|
|
|
| |
use config object instead. Cuts about 15% off the load time. (#734)
|
|
|
|
| |
:exclude to make it consistent with controller filters
|
| |
|
| |
|
| |
|
|
|
|
| |
of `.column_names`
|
|
|
| |
Normally the table for abstract class won't be existed, so we should not trying to call `#column_names` on it.
|
|
|
|
| |
raising NameError, closes #477.
|
| |
|
|
|
|
|
| |
I have to keep in mind that 1.8.7 does *not* preserve the hash order.
Guys, let's move to use 1.9.2 in production!
|
| |
|
|
This will allow us to do a rootless JSON/XML request to server.
|