Skip to content
Commits on Feb 4, 2016
  1. @vipulnsward

    - app generate option --skip-sprockets leaves jquery-rails gem, which…

    vipulnsward committed
    … relies on sprockets environment
    
    - Remove jquery-rails if --skip-sprockets is true
    
    Fixes #23431
  2. @dhh

    Turbolinks has moved out

    dhh committed
    All grown up and shit!
  3. @dhh

    Redis is now only needed if you want to use Action Cable in production

    dhh committed
    So no need to have it on by default in the Gemfile.
Commits on Feb 3, 2016
  1. @kamipo

    Active Record supports MySQL >= 5.0

    kamipo committed
    Currently some features uses `information_schema` (e.g. foreign key
    support). `information_schema` introduced since MySQL 5.0.
  2. @alexeyzab

    Add dummy apple icon files

    alexeyzab committed
    Previously Safari would try to load these files when you visit
    localhost:3000. That created two exceptions in the log. It also caused
    the exception notifier to send them out.
    
    In response to #23427
  3. @y-yagi
Commits on Feb 2, 2016
  1. @tenderlove

    Generated engines should protect from forgery

    tenderlove committed
    Generated engines should call `protect_from_forgery`.  If this method
    isn't called, then the Engine could be susceptible to XSS attacks.
    Thanks @tomekr for reporting this to us!
Commits on Feb 1, 2016
  1. @schneems

    Merge pull request #23057 from schneems/schneems/default-puma-config

    schneems committed
    Add Default Puma Config
  2. @matthewd

    Merge pull request #23385 from matthewd/default-subscription-adapter

    matthewd committed
    Change default ACa adapter for development & test
  3. @matthewd

    Merge pull request #23381 from matthewd/uneventful-redis

    matthewd committed
    Redis sans EventMachine
Commits on Jan 31, 2016
  1. @matthewd
  2. @matthewd

    Switch the default redis adapter to a single-stream model

    matthewd committed
    This new adapter does get a little more intimate with the redis-rb gem's
    implementation than I would like, but it's the least bad of the
    approaches I've come up with.
Commits on Jan 30, 2016
  1. @y-yagi

    remove unnecessary gsub for `action_cable_meta_tag`

    y-yagi committed
    If the specified `skip_action_cable` option, so as not to output the
    `action_cable_meta_tag` in template, gsub is unnecessary.
    
    ref: https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt#L6..L8
  2. @rafaelfranca

    Merge pull request #23317 from rfmanuel/after-bundle-in-rails-plugin-…

    rafaelfranca committed
    …template
    
    Add an after_bundle callback in Rails plugin templates
Commits on Jan 29, 2016
  1. @schneems

    Add Default Puma Config

    schneems committed
    When the `puma` command is run without any configuration options it will detect presence of a `config/puma.rb` file and use that. Currently there is discrepancy between `puma` command and `rails server` but Evan said it would be reasonable to add in reading in config from the default location. I am working on that right now as a feature in puma/puma.
    
    Why do we need this? By default Puma uses 16 threads, and by default ActiveRecord only has 5 threads. Due to the architecture of AR it is guaranteed that if you're running with fewer DB connections than your server has threads you will hit `ActiveRecord::ConnectionTimeoutError ` eventually if your app gets modest amounts of traffic. Since we are providing a default webserver, we should provide reasonable configuration for that webserver.
    
    This PR does a few things, first it sets the default Puma thread count to 5 to mach ActiveRecord's default. It sets the default environment to `"development"` and the default port to 300 so that booting the server with `$ puma` will give you the same default port as `rails server`. It is worth mentioning that by reading in from `PORT` environment variable this config can work with containerized deployments, such as on Heroku. 
    
    We are not using worker processes by default, that way JRuby and windows devs can use this configuration without modification. I went ahead and included a default `on_worker_boot`. It won't be used unless a worker count is specified, that means this config will not use it. Even though it's not being used now It will make someone who wants to try modifying their config to run extra workers easier.
    
    cc/ @pixeltrix
  2. @matthewd
Commits on Jan 28, 2016
  1. @rfmanuel
Commits on Jan 27, 2016
  1. @dhh
Commits on Jan 26, 2016
  1. @claudiob

    [ci skip] Don’t explicitly mention EventMachine

    claudiob committed
    Since #23152 eliminated the EventMachine dependency, we don’t need to
    explicitly mention EventMachine.
    
    Nevertheless, I'm not 100% sure about saying "the websocket-driver loop"
    driver… any suggestions, @matthewd or @pixeltrix ? :sweat_smile:
    
    [ci skip]
Commits on Jan 24, 2016
  1. @dhh

    Merge pull request #23152 from matthewd/actioncable-concurrent

    dhh committed
    Eliminate the EventMachine dependency
  2. @prathamesh-sonpatki

    Pare back default `index` option for the migration generator

    prathamesh-sonpatki committed
    - Using `references` or `belongs_to` in migrations will always add index
      for the referenced column by default, without adding `index:true` option
      to generated migration file.
    - Users can opt out of this by passing `index: false`.
    - Legacy migrations won't be affected by this change. They will continue
      to run as they were before.
    - Fixes #18146
  3. @matthewd

    Ditch the EM error logging helper

    matthewd committed
    We're no longer doing our work in the EM event loop, so errors are quite
    unlikely, and if they do occur, they're not really our responsibility to
    handle.
  4. @prathamesh-sonpatki
Commits on Jan 23, 2016
  1. @joyvuu-dave
Commits on Jan 22, 2016
  1. @y-yagi

    remove `per_form_csrf_tokens` initializer from Rails API

    y-yagi committed
    Because the form is not in the Rails API,
    `per_form_csrf_tokens` initializer I think unnecessary.
  2. @JuanitoFatas
Commits on Jan 21, 2016
  1. @rafaelfranca

    Merge pull request #23078 from y-yagi/add_application_mailer_rb_to_mo…

    rafaelfranca committed
    …untable_engine
    
    add application_mailer.rb to template of mountable engine
  2. @plentz
Commits on Jan 18, 2016
  1. @maclover7
  2. @maclover7
Commits on Jan 15, 2016
  1. @y-yagi
  2. @y-yagi

    add application_mailer.rb to template of mountable engine

    y-yagi committed
    since 9446e38, generated mailer inherents from ApplicationMailer,
    ApplicationMailer is required in the mountable engine.
Commits on Jan 13, 2016
  1. @jonatack

    Improve generated config initializer files

    jonatack committed
    - Fix grammar.
    - Improve readability/understanding.
    - Wrap lines at 80 characters.
    
    [skip ci]
Commits on Jan 6, 2016
  1. @schneems

    Default new apps to tag logs with `request_id`

    schneems committed
    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`.
  2. @rafaelfranca

    Merge pull request #22939 from y-yagi/make_generated_controller_test_…

    rafaelfranca committed
    …file_work_correctly
    
    make generated controller test work correctly
Something went wrong with that request. Please try again.