Skip to content
Snippets Groups Projects

Rails 5 upgrade

Merged automation_daan requested to merge dd-rails-5 into master

Created by: daandavidsz

Eerste ruwe poging van een upgrade naar Rails 5. Schiet er maar flink op @zwippie en @timraasveld

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Unable to load the diff
  • Created by: timraasveld

    Misschien een comment en/of TODO waarom je hiervoor hebt gekozen; vermoedelijk omdat stabiele release nog niet Rails 5 compatible is of het gedrag verandert?

  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • 10 9 gem 'responders'
    11 10 gem 'rack-haproxy_status', '~> 0.8.1'
    12 11
    13 gem 'sprockets-rails', '~> 3.0.4'
    12 gem 'sprockets-rails', '~> 3.2.0'
    14 13
    15 14 gem 'appsignal', '~> 2.1.0'
    16 15
    • Created by: timraasveld

      Vraag me niet waarom ik deze gem ooit had toegevoegd, maar wordt in ieder geval niet gebruikt, dus hele regel mag er van mij wel uit ;)

  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • 10 9 gem 'responders'
    11 10 gem 'rack-haproxy_status', '~> 0.8.1'
    12 11
    • Created by: timraasveld

      We gebruiken meestal semantic version voor gems die ook op productie gebruikt worden. Of heb je een reden om dat hier niet te doen?

  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • 9 9 # Do not eager load code on boot.
    10 10 config.eager_load = false
    11 11
    12 # Show full error reports and disable caching.
    13 config.consider_all_requests_local = true
    12 # Show full error reports.
    13 config.consider_all_requests_local = true
    14
    15 config.action_controller.perform_caching = true
    • Created by: timraasveld

      Caching is in het geval van CATja vrijwel altijd wenslijk tijdens development, anders moeten er namelijk bij elk nieuwe antwoord n+1 verzoeken naar OpenCPU gaan.

  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • Unable to load the diff
  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • 5 # Once upgraded flip defaults one by one to migrate to the new default.
    6 #
    7 # Read the Guide for Upgrading Ruby on Rails for more info on each option.
    8
    9 # Enable per-form CSRF tokens. Previous versions had false.
    10 Rails.application.config.action_controller.per_form_csrf_tokens = false
    11
    12 # Enable origin-checking CSRF mitigation. Previous versions had false.
    13 Rails.application.config.action_controller.forgery_protection_origin_check = false
    14
    15 # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
    16 # Previous versions had false.
    17 ActiveSupport.to_time_preserves_timezone = false
    18
    19 # Require `belongs_to` associations by default. Previous versions had false.
    20 Rails.application.config.active_record.belongs_to_required_by_default = true
  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • 10 9 gem 'responders'
    11 10 gem 'rack-haproxy_status', '~> 0.8.1'
    12 11
    • Created by: timraasveld

      Semantic version is vooral handig omdat je dan snel minor (vaak security) updates kan installeren met bundle update zonder meteen een major (vaak breaking) update te krijgen.

  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • Unable to load the diff
    • Created by: timraasveld

      Check. Je kunt echter ook 0.4.0-beta van Rubygems halen, die verwijst naar dezelfde commit en scheelt weer een github request.

  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • automation_daan
    automation_daan @automation started a thread on commit 02be8642
  • 9 9 # Do not eager load code on boot.
    10 10 config.eager_load = false
    11 11
    12 # Show full error reports and disable caching.
    13 config.consider_all_requests_local = true
    12 # Show full error reports.
    13 config.consider_all_requests_local = true
    14
    15 config.action_controller.perform_caching = true
    Please register or sign in to reply
    Loading