aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge pull request #27926 from st0012/freeze-cache-instrument-nameRafael França2017-02-132-2/+2
|\ \ | |/ |/| Freeze fragment cache related instrument name.
| * Freeze fragment cache related instrument name.Stan Lo2017-02-072-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
* | Remove unused requireRyuta Kamizono2017-02-122-3/+0
| | | | | | | | | | | | These files are not using `strip_heredoc`. Closes #27976
* | Removed the `attribute_accessors` required file:Edouard CHIN2017-02-121-1/+0
| | | | | | | | - This file is no more needed, the call to `cattr_reader` were removed in https://github.com/rails/rails/commit/9e2948e750fa3f641f20adad4b4ecae89b35faa7#diff-c5146df11f35304765e9ceebed108f57L60 and https://github.com/rails/rails/commit/1fe0a1b5ebebb1372968606b85ce08b93bc145c8#diff-c5146df11f35304765e9ceebed108f57L99
* | Add `Style/EmptyLinesAroundMethodBody` in `.rubocop.yml` and remove extra ↵Ryuta Kamizono2017-02-123-3/+0
|/ | | | empty lines
* Correct spellingBenjamin Fleischer2017-02-055-5/+5
| | | | | | | ``` go get -u github.com/client9/misspell/cmd/misspell misspell -w -error -source=text . ```
* Properly escape test namesAkira Matsuda2017-02-021-3/+3
| | | | since the test names become Regexp filters, non-escaped test names cause RegexpError on isolated test via bin/test
* Remove deprecated callbacks from ActionDispatch middlewaresRafael Mendonça França2017-01-316-162/+57
|
* 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-232-0/+15
| | | | | | | | | | | | | | | | | | | | 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)
* | Use ActionDispatch::IntegrationTest http helper methodsAndrew White2017-01-181-45/+41
| | | | | | | | | | | | | | | | Mixing Rack::Test::Methods into ActionDispatch::IntegrationTest seems to trigger Ruby bug 13107[1]. By using our methods instead of rack-test we shouldn't trigger the bug in Forwardable. [1]: https://bugs.ruby-lang.org/issues/13107
* | :warning: "Use assert_nil if expecting nil. This will fail in MT6."Akira Matsuda2017-01-181-1/+5
| |
* | :warning: "Use assert_nil if expecting nil. This will fail in MT6."Akira Matsuda2017-01-182-10/+22
| | | | | | | | | | | | These are followups for 307065f959f2b34bdad16487bae906eb3bfeaf28, but TBH I'm personally not very much confortable with this style. Maybe we could override assert_equal in our test_helper not to warn?
* | Fix all rubocop violationsRafael Mendonça França2017-01-171-1/+1
| |
* | Don't pollute Object with rubinius_skip and jruby_skipAkira Matsuda2017-01-171-9/+9
| | | | | | | | we call them only in the tests
* | Merge pull request #27692 from y-yagi/make_render_work_with_ac_paramsEileen M. Uchitelle2017-01-161-1/+0
|\ \ | | | | | | make `render` work with AC::Params
| * | make `render` work with AC::Paramsyuuji.yaginuma2017-01-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | In 4.2, since AC::Params inherited `Hash`, processing in the case of `Hash` was done. But in 5.x, since AC::Params does not inherit `Hash`, need to add care for AC::Params. Related to 00285e7cf75c96553719072a27c27e4ab7d25b40
* | | 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
|