Skip to content

Instantly share code, notes, and snippets.

@radavis
Last active October 21, 2016 14:52
Show Gist options
  • Select an option

  • Save radavis/e5801a7cccb4738d92a2978545efbb09 to your computer and use it in GitHub Desktop.

Select an option

Save radavis/e5801a7cccb4738d92a2978545efbb09 to your computer and use it in GitHub Desktop.
Upgrading from Rails 4 to 5
  1. bundle

  2. rake rails:update

# Gemfile
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'pg', '~> 0.18'
gem 'sass-rails', '~> 5.0'
gem 'coffee-rails', '~> 4.2'

group :development, :test do
  gem 'rspec-rails', '~> 3.5'
end
  1. bundle update and then rake rails:update again

# app/models/application_record.rb
class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
end

All models should inherit from ApplicationRecord.

  1. Replace config.serve_static_files with config.public_file_server.enabled = true

  2. Replace config.static_cache_control with config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }

  3. Delete raise_in_transactional_callbacks line from config/application.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment