aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #27647 from Shopify/fully-eagerload-journeyRafael França2017-01-304-0/+28
|\ | | | | Fully initialize routes before the first request is handled
| * Fully initialize routes before the first request is handledJean Boussier2017-01-184-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | `AD::Journey::GTG::Simulator` is lazily built the first time `Journey::Router#find_routes` is invoked, which happens when the first request is served. On large applications with many routes, building the simulator can take several hundred milliseconds (~700ms for us). Triggering this initialization during the boot process reduces the impact of deploys on the application response time.
* | Change ActionView ERB Handler from Erubis to ErubiJeremy Evans2017-01-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1.
* | Delete PATH_INFO after each controller test requestDominic Cleal2017-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | Prevents PATH_INFO from being used to infer the request format in later test requests when no explicit format is given. As the request PATH_INFO may be set before a request, it can't be deleted during pre-request scrubbing. Fixes #27774
* | Add examples for behaviour about redirection with and without options. Fixes ↵Vipul A M2017-01-211-0/+8
| | | | | | | | #27715 [ci skip] (#27730)
* | Revert "significant speedup of AC::Parameters#permit" ↵David Heinemeier Hansson2017-01-161-3/+1
| | | | | | | | [26dd9b26ab7317f94fd285245879e888344143b2] as it broke Parameters#to_h on at least fields_for-style nested params.
* | Add missing requireDavid Heinemeier Hansson2017-01-161-0/+1
| | | | | | | | This was preventing the test suite from being run in isolation
* | `respond_to_missing?` should fallback to `super` where method_missing could ↵Akira Matsuda2017-01-151-1/+1
| | | | | | | | call `super`
* | AC::ParamsWrapper::Options needs anonymous superclassAkira Matsuda2017-01-131-1/+1
| | | | | | | | | | | | it has some methods that override the accessors and calls the original accessors via `super` this partially reverts 9360b6be63b7a452535699bcf6ae853df7f5eea7
* | class Foo < Struct.new(:x) creates an extra unneeded anonymous classAkira Matsuda2017-01-132-2/+2
| | | | | | | | because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
* | fix method name in `Renderer` doc [ci skip]yuuji.yaginuma2017-01-121-1/+2
| | | | | | | | `ActionController::Renderer.defaults` was removed in 2db7304
* | Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-124-7/+7
| | | | | | | | (I personally prefer writing one string in one line no matter how long it is, though)
* | Revert "Merge pull request #27586 from maclover7/jm-fix-27584"Rafael Mendonça França2017-01-111-2/+3
| | | | | | | | | | | | | | This reverts commit 5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5, reversing changes made to 5f03172f54a58a57a48a3121562beb2cef866cbe. Reason: It caused a regression. The test case is on the PR.
* | Fix grammar in action_dispatch/http/parameters.rb [ci skip]kenta-s2017-01-111-1/+1
|/
* Current default Rails app encoding "utf-8" looks more like a W3C charset ↵Akira Matsuda2017-01-111-1/+1
| | | | than a ruby encoding
* Use already defined Encoding constant rather than freezing a StringAkira Matsuda2017-01-111-1/+1
|
* Make ActionDispatch::Request.parameter_parsers public APIRafael Mendonça França2017-01-111-1/+11
| | | | | | | It is the proper way to configure custom parameters parser and it was being recommended in the deprecation for ActionDispatch::ParamsParser. [ci skip]
* Update `cookies` helper on all HTTP requestsJon Moss2017-01-051-3/+2
| | | | | | | | | Regression introduced by ae29142142324545a328948e059e8b8118fd7a33 / 8363b879fe759f0645179f4521cc64795efbee6e. Previously, cookies were only updated on `GET` requests. Now we will update the helper for all requests, as part of `process`. Added regression tests for all available HTTP method helpers in `ActionController::TestCase`.
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-054-4/+4
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* String#end_with? should be faster than Regexp hereAkira Matsuda2017-01-051-1/+1
|
* No need to :doc: a public methodAkira Matsuda2017-01-051-1/+1
|
* Remove deprecated ActionController::Metal.callRafael Mendonça França2017-01-032-17/+7
|
* Remove deprecated Metal#envRafael Mendonça França2017-01-031-5/+0
|
* Extract variant setter to process methodJon Moss2017-01-022-4/+10
| | | | | | | Provide an API interface similar to how format is handled in Controllers. In situations where variants are not needed (ex: in Action Mailer) the method will simply trigger a no-op, and will not affect end users.
* Bump license years for 2017Jon Moss2016-12-312-2/+2
| | | | | | | | Per https://www.timeanddate.com/counters/firstnewyear.html, it's already 2017 in a lot of places, so we should bump the Rails license years to 2017. [ci skip]
* fix with_routing when testing api only controllersJulia López2016-12-291-2/+5
|
* Use `next` instead of `break`; avoid terminating whole loopJon Moss2016-12-291-1/+1
| | | | | | | | | | | | | | We want to avoid terminating the whole loop here, because it will cause parameters that should be removed to not be removed, since we are terminating early. In this specific case, `param2` is processed before `param1` due to the reversing of `route.parts`, and since `param2` fails the check on this line, it would previously cause the whole loop to fail, and `param1` would still be in `parameterized_parts`. Now, we are simply calling `next`, which is the intended behavior. Introduced by 8ca8a2d773b942c4ea76baabe2df502a339d05b1. Fixes #27454.
* Use proper output format [ci skip] (#27498)प्रथमेश Sonpatki2016-12-291-1/+1
|
* Update request.rb --ci skipShardul Parab2016-12-291-0/+3
| | | | | | | | | | | | | | | | Documentation for ActionDispatch::Request#key? [ci skip] Update request.rb --ci skip Documentation for ActionDispatch::Request#key? [ci skip] Also made change after the review by @rafaelfranca . Update request.rb --ci skip Documentation for ActionDispatch::Request#key? [ci skip] Also made change after the review by @rafaelfranca . Update request.rb --ci skip
* Fix Rubocop violations and fix documentation visibilityRafael Mendonça França2016-12-281-1/+1
| | | | | | Some methods were added to public API in 5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of the public API.
* Optimize Journey::Route#scoreBen Hughes2016-12-282-5/+14
| | | | | | | | Scoring routes based on constraints repeated many type conversions that could be performed in the outer loop. Determinations of score and fitness also used Array operations that required allocations. Against my benchmark with a large routeset, this reduced object allocations by over 30x and wall time by over 3x.
* renderers typo fix [ci skip]ota42y2016-12-271-1/+1
|
* Shave a couple of allocations off Journey scan & parseMatthew Draper2016-12-253-203/+207
|
* Privatize unneededly protected methods in Action PackAkira Matsuda2016-12-2415-83/+82
|
* No need to nodoc private methodsAkira Matsuda2016-12-245-24/+24
|
* Describe what we are protectingAkira Matsuda2016-12-231-0/+2
|
* updating docsAaron Patterson2016-12-211-0/+4
|
* Document and update API for `skip_parameter_encoding`Aaron Patterson2016-12-215-23/+44
| | | | | | | | This commit changes `parameter_encoding` to `skip_parameter_encoding`. `skip_parameter_encoding` will set encoding on all parameters to ASCII-8BIT for a given action on a particular controller. This allows the controller to handle data when the encoding of that data is unknown, for example file systems or truly binary parameters.
* Merge pull request #27408 from matthewd/charset-fixMatthew Draper2016-12-202-4/+6
|\ | | | | Only default the response charset when it is first set
| * Only default the response charset when it is first setMatthew Draper2016-12-202-4/+6
| | | | | | | | | | If it is explicitly cleared (e.g., response.sending_file = true), then we should not try to set it again.
* | Merge pull request #27146 from maclover7/jm-fix-27145Eileen M. Uchitelle2016-12-191-2/+0
|\ \ | |/ |/| Do not clear HTTP_COOKIES header after request
| * Do not clear HTTP_COOKIES header after requestJon Moss2016-12-111-2/+0
| |
* | Missing require "active_support/testing/constant_lookup"Akira Matsuda2016-12-141-0/+1
|/
* Do not raise exception when content_type is a empty stringRafael Mendonça França2016-12-091-1/+1
| | | | | When content type header is blank we were raising an exception because `empty?` was being called on nil.
* Only move fixture_file_upload to IntegrationTestMatthew Draper2016-12-072-18/+22
| | | | | The rest of the helpers are better placed on Session -- and this is the only one that cares which class it is defined on.
* Do not try to set the content_type if the format is nilRafael Mendonça França2016-12-051-1/+1
|
* Document 'false' as option for 'action_on_unpermitted_parameters'Daniel Carral2016-11-291-2/+2
| | | | [ci skip]
* [ci skip] Update the `as` docs.Kasper Timm Hansen2016-11-271-1/+2
| | | | Mention the Accept header and how that figures into the request format.
* Remove default argument value.Kasper Timm Hansen2016-11-271-1/+1
| | | | Wrongly added when fixing the request path wrangling.
* Merge pull request #27140 from ↵Rafael França2016-11-251-1/+1
|\ | | | | | | | | supercaracal/fix-force-ssl-if-session-store-disabled Fix a force ssl redirection bug that occur when session store disabled.