1. 22 11月, 2016 2 次提交
  2. 20 11月, 2016 2 次提交
  3. 19 11月, 2016 3 次提交
    • Y
      move CHANGELOG entry to the appropriate file [ci skip] · f5e738b6
      yuuji.yaginuma 提交于
      Follow up to #27098
      f5e738b6
    • E
      Fix incorrect output from rails routes when using singular resources issue #26606 · c79848e1
      Erick Reyna 提交于
      Rails routes (even rake routes in previous versions) output showed incorrect routes when an application use resource :controller, implying that edit_controller_path match with controller#show.
      The order of the output has changed to correct this. View #26606 for more information.
      
      Added a test case, change unit test in rake to expect the new output.
      Since the output of resource :controller is changing, the string spected of the railties/test/application/rake_test.rb test_rails_routes_with_controller_environment had to be modified.
      c79848e1
    • T
      Fix `ActionDispatch::IntegrationTest#open_session` · 064744be
      Tawan Sierek 提交于
      Reset a new session directly after its creation in
      `ActionDispatch::IntegrationTest#open_session`. Reset the session to a clean
      state before making it available to the client's test code.
      
      Issue #22742 reports unexpected behavior of integration tests that run multiple
      sessions. For example an `ActionDispatch::Flash` instance is shared across
      multiple sessions, though a client code will rightfully assume that each new
      session has its own flash hash.
      
      The following test failed due to this behavior:
      
          class Issue22742Test < ActionDispatch::IntegrationTest
            test 'issue #22742' do
              integration_session # initialize first session
              a = open_session
              b = open_session
      
              refute_same(a.integration_session, b.integration_session)
            end
          end
      
      Instead of creating a new `ActionDispatch::Integration::Session` instance,
      the same instance is shared across all newly opened test sessions. This is
      due to the way how new test sessions are created in
      `ActionDispatch::IntegrationTest#open_session`. The already existing
      `ActionDispatch::IntegrationTest` instance is duplicated  with `Object#dup`,
      This approach was introduced in commit 15c31c76. `Object#dup` copies the
      instance variables, but not the objects they reference. Therefore this issue
      only occurred when the current test instance had been tapped in such a way that
      the instance variable `@integration_session` was initialized before creating the
      new test session.
      
      Close #22742
      
      [Tawan Sierek + Sina Sadeghian]
      064744be
  4. 15 11月, 2016 3 次提交
  5. 13 11月, 2016 4 次提交
  6. 12 11月, 2016 3 次提交
    • X
      significant speedup of AC::Parameters#permit · 26dd9b26
      Xavier Noria 提交于
      The current implementation of AC::Parameters#permit builds permitted hashes and
      then calls permit! on them.
      
      This filtering is recursive, so we call permit! on terminal branches, but then
      ascendants call permit! on themselves when the recursion goes up the stack,
      which recurses all the way down again because permit! is recursive itself.
      Repeat this for every parent node and you get some scary O-something going on
      that I don't even want to compute.
      
      Instead, since the whole point of the permit recursion is to build permitted
      hashes along the way and at that point you know you've just come up with a
      valid filtered version, you can already switch the toggle on the spot.
      
      I have seen 2x speedups in casual benchmarks with small structures. As the
      previous description shows, the difference in performance is going to be a
      function of the nesting.
      
      Note that that the involved methods are private and used only by permit.
      26dd9b26
    • X
      adds a missing dot [ci skip] · df3c1eef
      Xavier Noria 提交于
      df3c1eef
    • X
      adds support for arbitrary hashes in strong parameters · e86524c0
      Xavier Noria 提交于
      e86524c0
  7. 11 11月, 2016 1 次提交
    • J
      Don't error on an empty CONTENT_TYPE · 773f71c8
      Jon Moss 提交于
      This commit prevents a possible issue wherein an empty CONTENT_TYPE
      header is sent in a request to a Rails application, and then `request.content_mime_type`
      would return `nil`. This is because the `has_content_type?` guard method
      was not properly checking the validity of a request's content type; it
      was only checking to see whether or not the header existed, not whether
      it had a value stored inside.
      
      Relatedly, after an internal discussion, it was determined that the
      `has_content_type?` method is not meant to be part of the public API,
      and is therefore changed to a `:nodoc:` method in this commit.
      
      The test for this behavior is a little bit ugly, for two reasons. One is
      that it was difficult to determine where to place the test... I figured
      the best place would be with the rest of the ParamsWrapper stuff, since
      that's where the original issue was. Also, we have to do some fancy
      footwork in calling `dispatch` on the test's controller manually... this
      is because `ActionController::TestCase` will throw an error if you try
      and pass in a nil content type, which is exactly what we are trying to
      test here... Because of that, we have to manually call in to the
      controller, and bypass the `post` request helper.
      
      Fixes #26912.
      
      This is a regression in behavior between Rails versions 4.2.x and 5.0.x,
      which was introduced via [this commit](https://github.com/rails/rails/commit/a9f28600e901b11a9222e34bfae8642bfb753186).
      773f71c8
  8. 05 11月, 2016 1 次提交
  9. 29 10月, 2016 2 次提交
    • R
      Add more rubocop rules about whitespaces · fe1f4b2a
      Rafael Mendonça França 提交于
      fe1f4b2a
    • G
      Support plain loggers in DebugExceptions · f99c3758
      Genadi Samokovarov 提交于
      I have been seeing people setting `Logger` instances for `config.logger`
      and it blowing up on `rails/web-console` usage.
      
      Now, I doubt many folks are manually setting `ActionView::Base.logger`,
      but given that `DebugExceptions` is running in a pretty fragile
      environment already, having it crash (and being silent) in those cases
      can be pretty tricky to trace down.
      
      I'm proposing we verify whether the `ActionView::Base.logger` supports
      silencing before we try to do it, to save us the headache of tracing it
      down.
      f99c3758
  10. 28 10月, 2016 1 次提交
  11. 27 10月, 2016 5 次提交
  12. 25 10月, 2016 1 次提交
  13. 23 10月, 2016 1 次提交
  14. 22 10月, 2016 2 次提交
  15. 18 10月, 2016 1 次提交
  16. 17 10月, 2016 1 次提交
  17. 15 10月, 2016 3 次提交
  18. 12 10月, 2016 1 次提交
  19. 11 10月, 2016 1 次提交
    • P
      ActionController::Parameters#deep_dup (#26567) · f80ddf30
      Pavel Evstigneev 提交于
      * ActionController::Parameters#deep_dup
      
      * Tests for ActionController::Parameters#deep_dup
      
      * Fix test for ActionController::Parameters#deep_dup
      
      * More tests for ActionController::Parameters#deep_dup
      
      [Rafael Mendonça França + Pavel Evstigneev]
      f80ddf30
  20. 10 10月, 2016 2 次提交