Update Gemfile
0 1 2 3 4 5 6 |
<code># update gem 'rails', '~> 5.2.2.1' to gem 'rails', '~> 6.0.0' # add gem 'webpacker', '~> 4.0'</code> |
Grab updates & install webpack
0 1 2 3 4 |
<code>bundle update bin/rails webpacker:install</code> |
Run your test and fix any issues. I mostly got issues revolving around update_attributes and expanding where.not() queries.
I had to update a bunch of
@resource.update_attributes(resource_params)
to
@resource.update(resource_params).
I also had scopes that looked like:
0 1 2 |
<code>scope :complete, -> { where.not(resume_id: nil, cover_letter_id: nil, company_id: nil) }</code> |
They had to be updated to:
0 1 2 |
<code>scope :complete, -> { where.not(resume_id: nil).where.not(cover_letter_id: nil).where.not(company_id: nil) }</code> |
Also, I had an issue with one of my render partials.
0 1 2 |
<code>Failure/Error: <%= render partial: :company_datum, collection: @company_data, locals: { offset: @company_data.offset }, cached: true %></code> |
Had to update it to:
0 1 2 |
<code><%= render partial: 'company_datum', collection: @company_data, locals: { offset: @company_data.offset }, cached: true %></code> |
Updating application.rb
0 1 2 3 4 5 6 7 |
<code># config/application.rb # change config.load_defaults 5.2 config.load_defaults 6.0 # I removed config.i18n.fallbacks = [I18n.default_locale]</code> |
If using rubocop: add this to your .rubocop.yml
0 1 2 3 4 5 |
<code>AllCops: Exclude: - 'node_modules/**/*' ...</code> |
Fin.