aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
* Added test to ensure that we dont break #to_h again when trying to restore ↵David Heinemeier Hansson2017-01-161-0/+5
| | | | the speed-up from 26dd9b26ab7317f94fd285245879e888344143b2 (cc: @fxn)
* Revert "significant speedup of AC::Parameters#permit" ↵David Heinemeier Hansson2017-01-162-8/+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`
* Small spelling errorLachlan Priest2017-01-141-4/+4
| | | existing_acrnoyms -> existing_acronyms
* 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-133-4/+4
| | | | 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-126-9/+9
| | | | (I personally prefer writing one string in one line no matter how long it is, though)
* Merge pull request #27610 from Envek/fix_and_speed_up_duration_parsingAndrew White2017-01-121-1/+1
|\ | | | | Fix inconsistent parsing of Durations with both months and years
| * Fix inconsistent results when parsing large durations and constructing ↵Andrey Novikov2017-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | durations from code ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true Duration parsing made independent from any moment of time: Fixed length in seconds is assigned to each duration part during parsing. Changed duration of months and years in seconds to more accurate and logical: 1. The value of 365.2425 days in Gregorian year is more accurate as it accounts for every 400th non-leap year. 2. Month's length is bound to year's duration, which makes sensible comparisons like `12.months == 1.year` to be `true` and nonsensical ones like `30.days == 1.month` to be `false`. Calculations on times and dates with durations shouldn't be affected as duration's numeric value isn't used in calculations, only parts are used. Methods on `Numeric` like `2.days` now use these predefined durations to avoid duplicating of duration constants through the codebase and eliminate creation of intermediate durations.
* | Revert "Merge pull request #27586 from maclover7/jm-fix-27584"Rafael Mendonça França2017-01-112-11/+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 Encoding::UTF_8 constant for default_{internal,external} in the testsAkira Matsuda2017-01-111-2/+2
| |
* | 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-052-3/+11
| | | | | | | | | 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-057-8/+8
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Fix style guide violationsRafael Mendonça França2017-01-051-3/+3
|
* 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-033-17/+11
|
* List full class nameJon Moss2017-01-031-1/+1
| | | | | | `Metal#env` --> `ActionController::Metal#env` [ci skip]
* Remove deprecated Metal#envRafael Mendonça França2017-01-032-5/+4
|
* 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-313-3/+3
| | | | | | | | 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-293-2/+33
|
* Use `next` instead of `break`; avoid terminating whole loopJon Moss2016-12-292-1/+22
| | | | | | | | | | | | | | 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-283-3/+3
| | | | | | 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-283-6/+15
| | | | | | | | 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.
* Small edits to actionpack/CHANGELOG.mdJon Moss2016-12-271-2/+2
| | | | | | | [ci skip] - change a period to a comma - add backticks for class + method
* Remove random extra spaces from Action Pack and Railties CHANGELOG.mdJon Moss2016-12-271-1/+1
| | | | [ci skip]
* renderers typo fix [ci skip]ota42y2016-12-271-1/+1
|
* assert_equal takes expectation firstAkira Matsuda2016-12-262-3/+3
|
* "Use assert_nil if expecting nil from ...:in `...'. This will fail in ↵Akira Matsuda2016-12-251-2/+1
| | | | minitest 6."
* "Use assert_nil if expecting nil from ...:in `...'. This will fail in MT6."Akira Matsuda2016-12-251-4/+4
|
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-2515-40/+40
|
* 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
|
* Privatize unneededly protected methods in Action Pack testsAkira Matsuda2016-12-2310-22/+20
|
* 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-216-54/+52
| | | | | | | | 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 #27414 from matthewd/fix-xml-vs-html-assertionMatthew Draper2016-12-211-12/+12
|\ | | | | Revise the "XML is not HTML" test
| * Revise the "XML is not HTML" testMatthew Draper2016-12-201-12/+12
| | | | | | | | | | | | It was depending on a side-effect of the old html-scanner, so was no longer proving what it intended to. Instead, assert more directly about the resulting observable difference.
* | Merge pull request #27408 from matthewd/charset-fixMatthew Draper2016-12-203-5/+14
|\ \ | | | | | | Only default the response charset when it is first set