EC • Clear architecture to prevent upgrade all at once • No big changes between 5.2 and 6.0 ◦ check all release notes for version > 3.2 ◦ check all issues in milestone 6.0 Why dare womany upgrade? 20
models • Run `Model.count` for all models • Fix code until all pass ◦ scopes, relationships, validates, callbacks • Check point: run each `Model.count` without error Simple case to verify 26
Check new files and config/ line by line ◦ new config: add or skip ◦ existed config: keep, delete, or adjust • New features setup with Rails 6 2. Upgrade and fix codes 27
check fields and setup • Some issues ◦ ugly code for nested fields ◦ Don’t support array in first level • Checkout point: `bin/rails s` and try form submit 4. Strong parameters 31
to upload image with carrierwave ◦ Need to keep ckeditor at 4.5.x ◦ Need all existed plugins to work well ◦ Need to work with Webpacker but not Sprocket • Separate ckeditor version and gem version ◦ gem version: v4.3.0 ◦ config.cdn_url: 4.5.11 • Checkout point: `bin/rails s` on Admin 5. ckeditor gem 32
`model/id-timestamp` • redirect external_host, allow_other_host: true 5.2+ ◦ fail with 500 code • params#to_unsafe_h 5.0+ • class name by zeitwerk 6.0+ ◦ API => Api Be careful 46
port number • Run `bin/rails s` ◦ use param `-p PORT` ◦ use param `-P PID` to run multiple rails server ◦ easy to use `binding.pry` for debugging Pro tips 47