aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #23862 from prathamesh-sonpatki/test-for-strong-etagRafael França2016-02-241-0/+8
|\ | | | | Added a test for generating Strong ETag
| * Added a test for generating Strong ETagPrathamesh Sonpatki2016-02-241-0/+8
| |
* | [ci skip] Replace usage of rake routes with rails routesAbhishek Jain2016-02-252-2/+2
|/
* Preparing for 5.0.0.beta3 releaseeileencodes2016-02-241-0/+2
| | | | Adds changelog headers for beta3 release
* Prep release for Rails 5 beta3eileencodes2016-02-241-1/+1
|
* No need CHANGELOG entry for #23849.Rafael Mendonça França2016-02-241-16/+0
| | | | | | | It is not a released feature so we don't need to add changelogs to changes on it. [ci skip]
* Show permitted flag in the output of AC::Parameters#inspectPrathamesh Sonpatki2016-02-243-8/+34
| | | | - Fixes #23822.
* Merge pull request #20851 from tomprats/indifferent-sessionsRafael Mendonça França2016-02-249-17/+147
|\ | | | | | | Give Sessions Indifferent Access
| * Update Session to utilize indiffernt accessTom Prats2016-01-308-16/+127
| |
| * Update session to have indifferent accessTom Prats2016-01-293-2/+21
| |
* | Merge branch 'actionmailer-cache'Rafael Mendonça França2016-02-245-69/+87
|\ \ | | | | | | | | | | | | | | | This is a rebased version of #22825. Closes #22825.
| * | Move private methods to the private visibilityRafael Mendonça França2016-02-241-10/+12
| | |
| * | Move Caching module to Abstract ControllerRafael Mendonça França2016-02-235-14/+18
| | | | | | | | | | | | | | | | | | Abstract Controller is the common component between Action Mailer and Action Controller so if we need to share the caching component it need to be there.
| * | Remove unnecessarily included modules in ActionController::CachingStan Lo2016-02-231-1/+0
| | |
| * | Move ActionMailer::Caching's content into ActionMailer::Base instead of ↵Stan Lo2016-02-231-7/+6
| | | | | | | | | | | | | | | | | | including it Remove useless helper in ActionDispatch::Caching and fix indentation
| * | Make caching configuration more flexibleStan Lo2016-02-232-7/+14
| | |
| * | Move most caching methods to ActionDispatch::Caching, and let ActionMailer ↵Stan Lo2016-02-232-54/+64
| | | | | | | | | | | | and ActionController to include it
| * | Move caching/fragments in ActionMailer and ActionController to ↵Stan Lo2016-02-232-6/+3
| | | | | | | | | | | | action_dispatch/caching/fragments
* | | Fix `request.ssl?` bug with Action CableJon Moss2016-02-232-0/+13
|/ / | | | | | | | | This bug affects `wss://` requests when running Action Cable in-app. Fixes #23620.
* | remove args from assert_nothing_raised in testsTara Scherner de la Fuente2016-02-221-1/+1
| |
* | Add `internal` attribute to routesJon Moss2016-02-224-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is meant to provide a way for Action Cable, Sprockets, and possibly other Rack applications to mark themselves as internal, and to exclude themselves from the routing inspector, and thus `rails routes` / `rake routes`. I think this is the only way to have mounted Rack apps be marked as internal, within AD/Journey. Another option would be to create an array of regexes for internal apps, and then to iterate over that everytime a request comes through. Also, I only had the first `add_route` method set `internal`'s default to false, to avoid littering it all over the codebase.
* | Make sure we unregister the mime type before registeringRafael Mendonça França2016-02-221-10/+22
| | | | | | | | Also make sure we don't change the global state of our test suite.
* | Transform the mime object to symbol when registering the parsersRafael Mendonça França2016-02-223-5/+15
| | | | | | | | | | This will keep our current API working without having the users to change their codebases.
* | Use symbol of mime type instead of object to get correct parserMehmet Emin İNAÇ2016-02-224-6/+22
| | | | | | | | | | | | After registering new `:json` mime type `parsers.fetch` can't find the mime type because new mime type is not equal to old one. Using symbol of the mime type as key on parsers hash solves the problem. Closes #23766
* | Make per form token work when method is not providedRafael Mendonça França2016-02-221-2/+16
| | | | | | | | | | | | When `button_to 'Botton', url` form was being used the per form token was not correct because the method that is was being used to generate it was an empty string.
* | Merge pull request #23752 from vipulnsward/23524-fix-button_to_deleteRafael Mendonça França2016-02-221-48/+60
|\ \ | | | | | | | | | Fixed passing of delete method on button_to tag, creating wrong form csrf token
| * | Refactored Request Forgery CSRF PerFormTokensController tests and DRY'ed ↵Vipul A M2016-02-221-70/+38
| | | | | | | | | | | | them up.
| * | Fixed passing of delete method on button_to tag, creating wrong form csrf tokenVipul A M2016-02-211-0/+44
| | | | | | | | | | | | Fixes #23524
* | | Fix typographical errorGustavo Villa2016-02-221-1/+1
| | |
* | | Merge pull request #23682 from ShikChen/fast_strxorSantiago Pastorino2016-02-211-1/+2
|\ \ \ | | | | | | | | Improve the performance of string xor operation
| * | | Improve the performance of string xor operationshik2016-02-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `each_byte` instead of `bytes` to speed up string xor operation and reduce object allocations. Inspired by commit 02c3867882d6d23b10df262a6db5f937ca69fb53. ``` ruby require 'benchmark/ips' require 'allocation_tracer' a = 32.times.map { rand(256) }.pack('C*') b = 32.times.map { rand(256) }.pack('C*') def xor_byte_strings1(s1, s2) s1.bytes.zip(s2.bytes).map { |(c1,c2)| c1 ^ c2 }.pack('c*') end def xor_byte_strings2(s1, s2) s2_bytes = s2.bytes s1.bytes.map.with_index { |c1, i| c1 ^ s2_bytes[i] }.pack('c*') end def xor_byte_strings3(s1, s2) s2_bytes = s2.bytes s1.each_byte.with_index { |c1, i| s2_bytes[i] ^= c1 } s2_bytes.pack('C*') end fail if xor_byte_strings1(a, b) != xor_byte_strings2(a, b) fail if xor_byte_strings1(a, b) != xor_byte_strings3(a, b) Benchmark.ips do |x| x.report('xor_byte_strings1') { xor_byte_strings1(a, b) } x.report('xor_byte_strings2') { xor_byte_strings2(a, b) } x.report('xor_byte_strings3') { xor_byte_strings3(a, b) } x.compare! end Tracer = ObjectSpace::AllocationTracer Tracer.setup(%i{type}) p xor_byte_strings1: Tracer.trace { xor_byte_strings1(a, b) } p xor_byte_strings2: Tracer.trace { xor_byte_strings2(a, b) } p xor_byte_strings3: Tracer.trace { xor_byte_strings3(a, b) } ``` ``` Warming up -------------------------------------- xor_byte_strings1 10.668k i/100ms xor_byte_strings2 11.814k i/100ms xor_byte_strings3 13.139k i/100ms Calculating ------------------------------------- xor_byte_strings1 116.667k (± 3.1%) i/s - 586.740k xor_byte_strings2 129.932k (± 4.3%) i/s - 649.770k xor_byte_strings3 142.506k (± 4.2%) i/s - 722.645k Comparison: xor_byte_strings3: 142506.3 i/s xor_byte_strings2: 129932.4 i/s - 1.10x slower xor_byte_strings1: 116666.8 i/s - 1.22x slower {:xor_byte_strings1=>{[:T_ARRAY]=>[38, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}} {:xor_byte_strings2=>{[:T_ARRAY]=>[3, 0, 0, 0, 0, 0], [:T_DATA]=>[1, 0, 0, 0, 0, 0], [:T_IMEMO]=>[2, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}} {:xor_byte_strings3=>{[:T_ARRAY]=>[1, 0, 0, 0, 0, 0], [:T_DATA]=>[1, 0, 0, 0, 0, 0], [:T_IMEMO]=>[2, 0, 0, 0, 0, 0], [:T_STRING]=>[2, 0, 0, 0, 0, 0]}} ```
* | | | Merge pull request #23695 from kaspth/remove-automatic-collection-cachingKasper Timm Hansen2016-02-202-17/+6
|\ \ \ \ | |_|/ / |/| | | Make collection caching explicit.
| * | | Make collection caching explicit.Kasper Timm Hansen2016-02-202-17/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having collection caching that wraps templates and automatically tries to infer if they are cachable proved to be too much of a hassle. We'd rather have it be something you explicitly turn on. This removes much of the code and docs to explain the previous automatic behavior. This change also removes scoped cache keys and passing cache_options.
* | | | Deprecate AC::Parameters#== with a HashBenjamin Quorning2016-02-192-11/+18
| | | |
* | | | Fix AC::Parameters#== with other AC::ParametersBenjamin Quorning2016-02-192-3/+37
| | | | | | | | | | | | | | | | Creating a protected getter method for `@parameters`.
* | | | Tests for AC::Parameters#==Benjamin Quorning2016-02-191-0/+6
| | | |
* | | | Fix master buildJon Moss2016-02-181-1/+1
|/ / /
* | | fields_for_style needs to test for AC::ParametersAaron Patterson2016-02-172-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While iterating an AC::Parameters object, the object will mutate itself and stick AC::Parameters objects where there used to be hashes: https://github.com/rails/rails/blob/f57092ad728fa1de06c4f5fd9d09dcc2c4738fd9/actionpack/lib/action_controller/metal/strong_parameters.rb#L632 If you use `permit` after this iteration, the `fields_for_style` method wouldn't return true because the child objects are now AC::Parameters objects rather than Hashes. fixes #23701
* | | partially revert 69009f4473637a44ade26d954ef5ddea6ff903f2Aaron Patterson2016-02-171-4/+1
| | | | | | | | | | | | | | | we need to continue setting the body on the request object because of Fiber based streaming templates. Fixes #23659
* | | Implement ActionController::Parameters#inspectBenjamin Quorning2016-02-172-1/+14
| | | | | | | | | | | | Now that AC::Parameters is no longer a Hash, it shouldn't look like a hash.
* | | Merge pull request #23729 from maclover7/rm-unused-journeyRafael França2016-02-172-8/+0
|\ \ \ | | | | | | | | Remove unused Journey code
| * | | Remove unused Journey codeJon Moss2016-02-172-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `VERSION` shouldn't be there anymore since Journey is technically part of Action Dispatch now (and thus Action Pack, and follows the normal Rails versioning scheme) - `backwards.rb` was only in the file tree because early in the history or Journey (back in 2011!), it was moved from under the Rack namespace, to its own namespace, Journey! This file is no longer required, and is assigning constants that are no longer needed.
* | | | Fix typoRafael Mendonça França2016-02-171-1/+1
| | | |
* | | | Merge pull request #23712 from ↵Rafael França2016-02-172-10/+3
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | bf4/incorrect_to_accept_json_api_and_not_render_spec The JSON API media type should only work wih a JSON API handler
| * | | | The JSON API media type should only work wih a JSON API handlerBenjamin Fleischer2016-02-162-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the media type 'application/vnd.api+json' is a spec, it is inappropriate to handle it with the JSON renderer. This PR removes support for a JSON API media type. I would recommend the media type be registered on its own as `jsonapi` when a jsonapi Renderer and deserializer (Http::Parameters::DEFAULT_PARSERS) are added. Is related to work in https://github.com/rails/rails/pull/21496
* | | | | Fix code styleRafael Mendonça França2016-02-171-3/+4
| |/ / / |/| | | | | | | | | | | This change was added in #23203 and it was not conforming our code style.
* | | | Merge pull request #23661 from meinac/add_gzip_mime_typeRichard Schneeman2016-02-163-1/+6
|\ \ \ \ | | | | | | | | | | application/gzip added as default mime type into mime type list
| * | | | application/gzip added as default mime type into mime type listMehmet Emin İNAÇ2016-02-133-1/+6
| | | | |
* | | | | Merge pull request #23203 from vipulnsward/22979-show-tags-on-exceptionRichard Schneeman2016-02-161-7/+11
|\ \ \ \ \ | |_|/ / / |/| | | | WIP: Errors in logs should show log tags as well.
| * | | | WIP: Errors in logs should show log tags as well.Vipul A M2016-02-121-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changed formatted_code_for to return array of logs to be tagged for each line - Changed some render tests to match new behaviour of return Fixes #22979