1. 08 1月, 2016 2 次提交
  2. 07 1月, 2016 20 次提交
    • K
      Merge pull request #22942 from Edouard-chin/rake-routes-error-message · a04cb1e3
      Kasper Timm Hansen 提交于
      Better error message when running `rake routes` with CONTROLLER arg:
      a04cb1e3
    • E
      Better error message when running `rake routes` with CONTROLLER arg: · ce13f791
      Edouard CHIN 提交于
      - `CONTROLLER` argument can now be supplied in different ways (Rails::WelcomeController, Rails::Welcome, rails/welcome)
      - If `CONTROLLER` argument was supplied but it does not exist, will warn the user that this controller does not exist
      - If `CONTROLLER` argument was supplied and no routes could be found matching this filter, will warn the user that no routes were found matching the supplied filter
      - If no routes were defined in the config/routes.rb file, will warn the user with the original message
      ce13f791
    • K
      Merge pull request #20109 from prathamesh-sonpatki/keep-only-one-root · c02b8561
      Kasper Timm Hansen 提交于
       Remove original root method from Base module and kept overridden implementation in Resources module.
      c02b8561
    • K
      Merge pull request #22956 from prathamesh-sonpatki/rm-splat-warning · 45da423b
      Kasper Timm Hansen 提交于
      Remove splat operator warning from ssl_test
      45da423b
    • D
      Merge pull request #22949 from schneems/schneems/request-id · 071cbb35
      David Heinemeier Hansson 提交于
      Default new apps to tag logs with `request_id`
      071cbb35
    • P
      Kept overridden root method and removed original method · ee1534e5
      Prathamesh Sonpatki 提交于
       - The root method is defined and documented in Base module and
         decorated in Resources module.
       - The documentation in Base module actually talks about method
         signature of decorated method from Resources module.
       - Argument handling was moved to decorated method in
         https://github.com/rails/rails/commit/977455cc2efb94f40b4c0d46d1842be198ed7c4c
         to handle options such as :as with directly passed path parameter.
       - To avoid the confusion, removed original root method from Base module
         and only kept overridden version in Resources module.
      
       - References - https://github.com/rails/rails/pull/12208 &
                      https://github.com/rails/rails/pull/12208#issuecomment-24350897.
      ee1534e5
    • P
      Remove splat operator warning from ssl_test · 70e73e4d
      Prathamesh Sonpatki 提交于
      - Removes following warning -
      
        `rails/actionpack/test/dispatch/ssl_test.rb:203: warning: `*' interpreted as argument prefix`.
      70e73e4d
    • R
      Merge pull request #22903 from... · 21dd85f1
      Rafael França 提交于
      Merge pull request #22903 from prathamesh-sonpatki/allow-ac-parameters-hash-as-an-argument-to-routes
      
      Allow AC::Parameters as an argument to url_helpers
      21dd85f1
    • R
      Merge pull request #22954 from yui-knk/suppress_warning_on_action_view · 2674f804
      Rafael França 提交于
      Suppress warning (instance variable @persisted not initialized)
      2674f804
    • P
      Allow AC::Parameters as an argument to url_helpers · a3107855
      Prathamesh Sonpatki 提交于
      - Earlier only Hash was allowed as params argument to url_helpers.
      - Now ActionController::Parameters instances will also be allowed.
      - If the params are not secured then it will raise an ArgumentError to
        indicate that constructing URLs with non-secure params is not recommended.
      - Fixes #22832.
      a3107855
    • Y
      54aaf85e
    • R
      Merge pull request #22952 from Baron-burton/contributing_documentation · 3cae35bd
      Rafael França 提交于
      Typo in Contributing.md documentation
      3cae35bd
    • B
      Typo in Contributing.md documentation · 1393bc9b
      Baron-burton 提交于
      Just fixed a small typo in the documentation.
      1393bc9b
    • R
      Merge pull request #22948 from kamipo/remove_delete_sql_in_sqlite3_adapter · e10cb1e8
      Rafael França 提交于
      Remove `delete_sql` in sqlite3 adapter
      e10cb1e8
    • S
      Default new apps to tag logs with `request_id` · 81d3bec4
      schneems 提交于
      In high volume applications it can be very difficult to figure out what is happening in logs because each request is not easily identified. For example 3 requests could look something like this:
      
      ```
      Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000
        Rendered welcome/index.html.erb within layouts/application (0.1ms)
      Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000
      Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000
        Rendered welcome/index.html.erb within layouts/application (0.1ms)
      Processing by WelcomeController#index as HTML
      Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      Processing by WelcomeController#index as HTML
        Rendered welcome/index.html.erb within layouts/application (0.1ms)
      Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
        Processing by WelcomeController#index as HTML
      Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      ```
      
      The `:request_id` log tag ensures that each request is tagged with a unique identifier. While they are still interleaved it is possible to figure out which lines belong to which requests. Like:
      
      ```
      [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000
      [c6034478-4026-4ded-9e3c-088c76d056f1]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:22 +0000
      [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:23 +0000
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML
      [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Processing by WelcomeController#index as HTML
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [abuqw781-5026-6ded-7e2v-788c7md0L6fQ] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c]  Processing by WelcomeController#index as HTML
      [acfab2a7-f1b7-4e15-8bf6-cdaa008d102c] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      ```
      
      Now if you have the logs and you find this unique ID you can filter to only look at information from that request. So a filtered log output would be very clear:
      
      ```
      [c6034478-4026-4ded-9e3c-088c76d056f1] Started GET "/" for 72.48.77.213 at 2016-01-06 20:30:21 +0000
      [c6034478-4026-4ded-9e3c-088c76d056f1]  Rendered welcome/index.html.erb within layouts/application (0.1ms)
      [c6034478-4026-4ded-9e3c-088c76d056f1] Processing by WelcomeController#index as HTML
      [c6034478-4026-4ded-9e3c-088c76d056f1] Completed 200 OK in 5ms (Views: 3.8ms | ActiveRecord: 0.0ms)
      ```
      
      In addition to this benefit the `:request_id` can be set via the `X-Request-ID` header so that the same request could be traced between multiple components. For example a request comes in Nginx (or another load balancer) could assign a request id. As the load balancer processes the request I can log using that id, then when the request is passed on to Rails, the same id is used. That way if a problem is determined to be not caused in Rails it could be traced back to other components with the same ID. You can set a value in nginx for example using something like this:
      
      ```
        location / {
            proxy_pass http://upstream;
            proxy_set_header X-Request-Id $pid-$msec-$remote_addr-$request_length;
        }
      # http://stackoverflow.com/questions/17748735/setting-a-trace-id-in-nginx-load-balancer
      ```
      
      Heroku sets this header value so problems like timeouts that are logged by like router can be traced back to specific request within the application.
      
      Whether you are using components that are setting request ID or not, all production applications can benefit from the additional debugging information of having a unique identifier for all requests. This change will only affect new applications, anyone can opt out by commenting or removing the line in `config/production.rb`.
      81d3bec4
    • R
      Remove `delete_sql` in sqlite3 adapter · 5a56b571
      Ryuta Kamizono 提交于
      `sql += " WHERE 1=1"` was introduced in 69cb942d.
      But it is not needed. ref https://www.sqlite.org/lang_delete.html
      5a56b571
    • R
      Merge pull request #22945 from kamipo/refactor_connection_insert_sql · 6a42f009
      Rafael França 提交于
      Refactor `connection.insert_sql`
      6a42f009
    • R
      Refactor `connection.insert_sql` · 2bce5adf
      Ryuta Kamizono 提交于
      `connection.insert_sql` is almost the same as `connection.insert`.
      2bce5adf
    • R
      Merge pull request #22933 from schneems/schneems/fix-broadcast · cc58837f
      Richard Schneeman 提交于
      [close #22917] Don't output to `STDOUT` twice
      cc58837f
    • S
      Remove unused instance variable · b33a5ed6
      schneems 提交于
      b33a5ed6
  3. 06 1月, 2016 18 次提交