diff options
Diffstat (limited to 'actionpack/CHANGELOG.md')
-rw-r--r-- | actionpack/CHANGELOG.md | 241 |
1 files changed, 171 insertions, 70 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 9f7c21b177..3b115a7bf7 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -3,121 +3,222 @@ *Max Melentiev* -* Introduce `BasicRendering` which is the most basic rendering implementation. It - allows to `render :text` and `render :nothing` without depending on Action View. +* Expand `ActionController::ConditionalGet#fresh_when` and `stale?` to also + accept a collection of records as the first argument, so that the + following code can be written in a shorter form. - *Łukasz Strzałkowski* + # Before + def index + @articles = Article.all + fresh_when(etag: @articles, last_modified: @articles.maximum(:updated_at)) + end -* Separate Action View completely from Action Pack. + # After + def index + @articles = Article.all + fresh_when(@articles) + end - *Łukasz Strzałkowski* + *claudiob* -* Development mode exceptions are rendered in text format in case of XHR request. +* Explicitly ignored wildcard verbs when searching for HEAD routes before fallback + + Fixes an issue where a mounted rack app at root would intercept the HEAD + request causing an incorrect behavior during the fall back to GET requests. + + Example: + ```ruby + draw do + get '/home' => 'test#index' + mount rack_app, at: '/' + end + head '/home' + assert_response :success + ``` + In this case, a HEAD request runs through the routes the first time and fails + to match anything. Then, it runs through the list with the fallback and matches + `get '/home'`. The original behavior would match the rack app in the first pass. + + *Terence Sun* + +* Migrating xhr methods to keyword arguments syntax + in `ActionController::TestCase` and `ActionDispatch::Integration` + + Old syntax: + + xhr :get, :create, params: { id: 1 } + + New syntax example: + + get :create, params: { id: 1 }, xhr: true *Kir Shatrov* -* Fix an issue where :if and :unless controller action procs were being run - before checking for the correct action in the :only and :unless options. +* Migrating to keyword arguments syntax in `ActionController::TestCase` and + `ActionDispatch::Integration` HTTP request methods. - Fixes #11799 + Example: - *Nicholas Jakobsen* + post :create, params: { y: x }, session: { a: 'b' } + get :view, params: { id: 1 } + get :view, params: { id: 1 }, format: :json + + *Kir Shatrov* -* Fix an issue where `assert_dom_equal` and `assert_dom_not_equal` were - ignoring the passed failure message argument. +* Preserve default url options when generating URLs. - Fixes #11751 + Fixes an issue that would cause default_url_options to be lost when + generating URLs with fewer positional arguments than parameters in the + route definition. - *Ryan McGeary* + *Tekin Suleyman* -* Allow REMOTE_ADDR, HTTP_HOST and HTTP_USER_AGENT to be overridden from - the environment passed into `ActionDispatch::TestRequest.new`. +* Deprecate *_via_redirect integration test methods. - Fixes #11590 + Use `follow_redirect!` manually after the request call for the same behavior. - *Andrew White* + *Aditya Kapoor* -* Fix an issue where Journey was failing to clear the named routes hash when the - routes were reloaded and since it doesn't overwrite existing routes then if a - route changed but wasn't renamed it kept the old definition. This was being - masked by the optimised url helpers so it only became apparent when passing an - options hash to the url helper. +* Add `ActionController::Renderer` to render arbitrary templates + outside controller actions. - *Andrew White* + Its functionality is accessible through class methods `render` and + `renderer` of `ActionController::Base`. -* Skip routes pointing to a redirect or mounted application when generating urls - using an options hash as they aren't relevant and generate incorrect urls. + *Ravil Bayramgalin* - Fixes #8018 +* Support `:assigns` option when rendering with controllers/mailers. - *Andrew White* + *Ravil Bayramgalin* -* Move `MissingHelperError` out of the `ClassMethods` module. +* Default headers, removed in controller actions, are no longer reapplied on + the test response. - *Yves Senn* + *Jonas Baumann* -* Fix an issue where rails raise exception about missing helper where it - should throw `LoadError`. When helper file exists and only loaded file from - this helper does not exist rails should throw LoadError instead of - `MissingHelperError`. +* Deprecate all *_filter callbacks in favor of *_action callbacks. - *Piotr Niełacny* + *Rafael Mendonça França* -* Fix `ActionDispatch::ParamsParser#parse_formatted_parameters` to rewind body input stream on - parsing json params. +* Allow you to pass `prepend: false` to protect_from_forgery to have the + verification callback appended instead of prepended to the chain. + This allows you to let the verification step depend on prior callbacks. - Fixes #11345 + Example: - *Yuri Bol*, *Paul Nikitochkin* + class ApplicationController < ActionController::Base + before_action :authenticate + protect_from_forgery prepend: false, unless: -> { @authenticated_by.oauth? } -* Ignore spaces around delimiter in Set-Cookie header. + private + def authenticate + if oauth_request? + # authenticate with oauth + @authenticated_by = 'oauth'.inquiry + else + # authenticate with cookies + @authenticated_by = 'cookie'.inquiry + end + end + end - *Yamagishi Kazutoshi* + *Josef Šimánek* -* Remove deprecated Rails application fallback for integration testing, set - `ActionDispatch.test_app` instead. +* Remove `ActionController::HideActions`. + + *Ravil Bayramgalin* + +* Remove `respond_to`/`respond_with` placeholder methods, this functionality + has been extracted to the `responders` gem. *Carlos Antonio da Silva* -* Remove deprecated `page_cache_extension` config. +* Remove deprecated assertion files. - *Francesco Rodriguez* + *Rafael Mendonça França* -* Remove deprecated constants from Action Controller: +* Remove deprecated usage of string keys in URL helpers. - ActionController::AbstractRequest => ActionDispatch::Request - ActionController::Request => ActionDispatch::Request - ActionController::AbstractResponse => ActionDispatch::Response - ActionController::Response => ActionDispatch::Response - ActionController::Routing => ActionDispatch::Routing - ActionController::Integration => ActionDispatch::Integration - ActionController::IntegrationTest => ActionDispatch::IntegrationTest + *Rafael Mendonça França* - *Carlos Antonio da Silva* +* Remove deprecated `only_path` option on `*_path` helpers. + + *Rafael Mendonça França* + +* Remove deprecated `NamedRouteCollection#helpers`. + + *Rafael Mendonça França* + +* Remove deprecated support to define routes with `:to` option that doesn't contain `#`. + + *Rafael Mendonça França* + +* Remove deprecated `ActionDispatch::Response#to_ary`. + + *Rafael Mendonça França* + +* Remove deprecated `ActionDispatch::Request#deep_munge`. + + *Rafael Mendonça França* + +* Remove deprecated `ActionDispatch::Http::Parameters#symbolized_path_parameters`. + + *Rafael Mendonça França* + +* Remove deprecated option `use_route` in controller tests. + + *Rafael Mendonça França* + +* Ensure `append_info_to_payload` is called even if an exception is raised. + + Fixes an issue where when an exception is raised in the request the additonal + payload data is not available. + + See: + * #14903 + * https://github.com/roidrage/lograge/issues/37 + + *Dieter Komendera*, *Margus Pärt* + +* Correctly rely on the response's status code to handle calls to `head`. + + *Robin Dupret* + +* Using `head` method returns empty response_body instead + of returning a single space " ". + + The old behavior was added as a workaround for a bug in an early + version of Safari, where the HTTP headers are not returned correctly + if the response body has a 0-length. This is been fixed since and + the workaround is no longer necessary. + + Fixes #18253. + + *Prathamesh Sonpatki* + +* Fix how polymorphic routes works with objects that implement `to_model`. -* Fix `Mime::Type.parse` when bad accepts header is looked up. Previously it - was setting `request.formats` with an array containing a `nil` value, which - raised an error when setting the controller formats. + *Travis Grathwell* - Fixes #10965 +* Stop converting empty arrays in `params` to `nil`. - *Becker* + This behaviour was introduced in response to CVE-2012-2660, CVE-2012-2694 + and CVE-2013-0155 -* Merge `:action` from routing scope and assign endpoint if both `:controller` - and `:action` are present. The endpoint assignment only occurs if there is - no `:to` present in the options hash so should only affect routes using the - shorthand syntax (i.e. endpoint is inferred from the path). + ActiveRecord now issues a safe query when passing an empty array into + a where clause, so there is no longer a need to defend against this type + of input (any nils are still stripped from the array). - Fixes #9856 + *Chris Sinjakli* - *Yves Senn*, *Andrew White* +* Fixed usage of optional scopes in url helpers. -* ActionView extracted from ActionPack + *Alex Robbin* - *Piotr Sarnacki*, *Łukasz Strzałkowski* +* Fixed handling of positional url helper arguments when `format: false`. -* Fix removing trailing slash for mounted apps #3215 + Fixes #17819. - *Piotr Sarnacki* + *Andrew White*, *Tatiana Soukiassian* -Please check [4-0-stable](https://github.com/rails/rails/blob/4-0-stable/actionpack/CHANGELOG.md) for previous changes. +Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/actionpack/CHANGELOG.md) for previous changes. |