aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove deprecated comparing support with `ActionController::Parameters`Rafael Mendonça França2016-10-101-9/+0
|
* Remove deprecated support to :text in renderRafael Mendonça França2016-10-101-12/+1
|
* Remove deprecated support to :nothing in renderRafael Mendonça França2016-10-091-5/+0
|
* Remove deprecated support to `:back` in `redirect_to`Rafael Mendonça França2016-10-091-8/+0
|
* Remove deprecated support for status option in headRafael Mendonça França2016-10-091-7/+1
|
* Remove deprecation at ActionController::BadRequestRafael Mendonça França2016-10-091-11/+1
|
* Remove obsolete comment about class-level respond_toAndrew White2016-10-011-2/+0
| | | | | | The class-level respond_to was extracted in ee77770 to responders gem [ci skip]
* Correct `render text:` deprecation messageJack Bracewell2016-09-141-1/+1
| | | The default Content-Type is `text/html`, not `text/plain`.
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-144-15/+15
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Merge pull request #26418 from y-yagi/fixes_26415Richard Schneeman2016-09-071-1/+1
|\ | | | | call `.to_h` to avoid using deprecated method
| * call `.to_h` to avoid using deprecated methodyuuji.yaginuma2016-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | `ActionController::Parameters#merge` call `HashWithIndifferentAccess#merge`. In addition, it calls `HashWithIndifferentAccess#update` from `HashWithIndifferentAccess#merge`, where it is called the `#to_hash` of argument. But `ActionController::Parameters#to_hash` is deprecated, warning message is displayed. To avoid this, modify to convert object to `Hash`. Fixes #26415
* | Merge pull request #26016 from nateberkopec/patch-1Vipul A M2016-09-071-2/+3
|\ \ | |/ |/| Clarify expires_now documentation
| * Clarify expires_now documentationNate Berkopec2016-09-061-2/+3
| | | | | | | | [ci skip]
* | RuboCop is 100% green :tada:Xavier Noria2016-09-021-1/+1
| |
* | fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-013-3/+3
| |
* | Move to_param undef closer to the deprecations.Kasper Timm Hansen2016-08-311-2/+4
| | | | | | | | | | | | | | Makes it clearer why we're doing this Add a comment to elaborate on what the undef means and move it closer to the deprecations so it's less likely for whoever pulls the deprecations that it should go too.
* | Do not allow to_param on AC::ParametersKir Shatrov2016-08-311-0/+3
| |
* | Allow `send_file` to declare a charsetJon Moss2016-08-291-0/+1
| | | | | | | | | | | | Removed my patch in favor of @tenderlove's less invasive approach. [Aaron Patterson & Jon Moss]
* | yl - remove extra …yunlei2016-08-231-1/+1
| |
* | Include the content of the flash in the auto-generated etag (#26250)David Heinemeier Hansson2016-08-221-0/+16
| | | | | | Include the content of the flash in the auto-generated etag
* | Merge pull request #26094 from igorkasyanchuk/masterRafael França2016-08-161-2/+2
|\ \ | | | | | | Show unpermitted parameters as symbols in logs (so they could be copy…
| * | Show unpermitted parameters as symbols in logs (so they could be copy-pasted ↵Igor Kasyanchuk2016-08-101-2/+2
| | | | | | | | | | | | to the code)
* | | Add three new rubocop rulesRafael Mendonça França2016-08-165-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* | | Fix deadlock that can occur when child live thread tries to load a constant ↵Alex Chinn2016-08-151-1/+6
| | | | | | | | | | | | after writing to the stream.
* | | AC::Metal is already defining default encoding as UTF 8, let's reuse it.Prathamesh Sonpatki2016-08-141-1/+1
| | |
* | | Mark method as nodocRafael Mendonça França2016-08-121-3/+3
| | | | | | | | | | | | They are not part of the public API
* | | [ci skip] Add documentation to Parameter EncodingAlex Kitchens2016-08-111-0/+1
| | |
* | | Allow specifying encoding of parameters by actionKerri Miller2016-08-091-0/+29
|/ / | | | | | | | | At GitHub we need to handle parameter encodings that are not UTF-8. This patch allows us to specify encodings per parameter per action.
* | revises more Lint/EndAlignment offensesXavier Noria2016-08-081-1/+1
| |
* | code gardening: removes redundant selfsXavier Noria2016-08-084-4/+4
| | | | | | | | | | | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* | applies remaining conventions across the projectXavier Noria2016-08-064-4/+0
| |
* | normalizes indentation and whitespace across the projectXavier Noria2016-08-068-118/+118
| |
* | modernizes hash syntax in actionpackXavier Noria2016-08-066-24/+24
| |
* | applies new string literal convention in actionpack/libXavier Noria2016-08-0617-73/+73
| | | | | | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* | Move the YAML hook closer to `init_with`.Kasper Timm Hansen2016-08-021-8/+9
| | | | | | | | | | Looked odd, so completely detached from the other necessary part of the implementation.
* | Replace implicit formats with a case statement.Kasper Timm Hansen2016-08-021-7/+8
| | | | | | | | | | | | The coder that Psych passes in has a `tag` method we can use to detect which serialization format we're reviving for. Use it and make it clearer alongside the `load_tags` fiddling.
* | Let Psych 2.0.9+ deserialize 2.0.8 serialized parameters.Kasper Timm Hansen2016-08-021-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we were to serialize an `ActionController::Parameters` on Psych 2.0.8, we'd get: ```yaml --- !ruby/hash:ActionController::Parameters key: :value ``` Because 2.0.8 didn't store instance variables, while 2.0.9 did: https://github.com/tenderlove/psych/commit/8f84ad0fc711a82a1040def861cb121e8985fd4c That, coupled with 2.0.8 calling `new` instead of `allocate` meant parameters was deserialized just fine: https://github.com/tenderlove/psych/commit/af308f8307899cb9e1c0fffea4bce3110a1c3926 However, if users have 2.0.8 serialized parameters, then upgrade to Psych 2.0.9+ and Rails 5, it would start to blow up because `initialize` will never be called, and thus `@parameters` will never be assigned. Hello, `NoMethodErrors` on `NilClass`! :) To fix this we register another variant of the previous serialization format and take it into account in `init_with`. I've tested this in our app and previously raising code now deserializes like a champ. I'm unsure how to test this in our suite because we use Psych 2.0.8 and don't know how to make us use 2.0.9+ for just one test.
* | Make Parameters support legacy YAML encodings.Kasper Timm Hansen2016-08-011-0/+19
|/ | | | | | | | | | | | | | | | | | | | | By changing ActionController::Parameter's superclass, Rails 5 also changed the YAML serialization format. Since YAML doesn't know how to handle parameters it would fallback to its routine for the superclass, which in Rails 4.2 was Hash while just Object in Rails 5. As evident in the tags YAML would spit out: 4.2: !ruby/hash-with-ivars:ActionController::Parameters 5.0: !ruby/object:ActionController::Parameters Thus when loading parameters YAML from 4.2 in Rails 5, it would parse a hash dump as it would an Object class. To fix this we have to provide our own `init_with` to be aware of the past format as well as the new one. Then we add a `load_tags` mapping, such that when the YAML parser sees `!ruby/hash-with-ivars:ActionController::Parameters`, it knows to call our `init_with` function and not try to instantiate it as a normal hash subclass.
* Fix incorrect indentation in method comment [ci skip]Junya Ogura2016-07-211-3/+3
|
* Fix adding implicitly rendered namespaced template digests to ETagsJavan Makhmali2016-07-131-1/+1
|
* Trust `Object#dup` in `ActionController::Parameters`, using ↵Tim Rogers2016-07-081-15/+1
| | | | | | `#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.
* Changes to a dupped `ActionController::Parameters` mutate the originalTim Rogers2016-07-071-0/+5
| | | | | | | | | | | | | | 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`.
* Fix adding implicitly rendered template digests to ETagsJavan Makhmali2016-06-281-1/+7
| | | | Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* `params.permitted?` is false by defaultJon Moss2016-06-231-0/+2
| | | | | In the docs: "+permit_all_parameters+ - If it's +true+, all the parameters will be permitted by default. The default is +false+."
* Update ActionController::Parameters documentation [ci skip]Benjamin Quorning2016-06-221-19/+18
| | | | | | | | | | The changes in this commit are twofold: 1. The examples showing `#require` accepting two arguments were wrong - you have to wrap the arguments (two, or more) in an array. 2. `ActionController::Parameters` has an `#inspect` method now (since https://github.com/rails/rails/pull/23732), and the documentation should reflect that.
* Tiny document fixes [ci skip]Robin Dupret2016-05-301-1/+1
| | | | | | Add a missing capital letter and avoid using absolute links to the API because they may refer to out-dated documentation on the Edge site.
* ActionController::Parameters: Fix #dig doc codeChristian Wesselhoeft2016-05-291-5/+5
| | | This example code wasn't getting wrapped in a `<code>` tag due to incorrect indentation.
* fix incorrect class name [ci skip]yuuji.yaginuma2016-05-281-1/+1
|
* Respect `log_warning_on_csrf_failure` setting for all CSRF failuresMatthew Caruana Galizia2016-05-231-1/+3
| | | | | | | | | | | | CSRF verification for non-XHR GET requests (cross-origin `<script>` tags) didn't check this flag before logging failures. Setting `config.action_controller.log_warning_on_csrf_failure = false` now disables logging for these CSRF failures as well. Closes #25086. Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* Action Mailer: Declarative exception handling with `rescue_from`.Jeremy Daer2016-05-151-12/+1
| | | | | | | | | | | | | | | | | | | | | | | Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`.