errbit
errbit copied to clipboard
Upgrade rails to 5.0
Aloha!
Main change: Upgrade Ruby on Rails to 5.0
Changes:
- Update rubygems to 3.3.19
- Update bundler to 2.3.19
- Add
activemodel-serializers-xmlgem. This functionality was removed from rails 5.0. We use it.to_xml. mongoidwas updated to6.0.3. This is latest version that works with rails 5.0.yajl-rubygem was removed without replacement. If we need more speed, we can look atojgem andoxgem for xml parsing.- Add
rails-controller-testinggem. Required by rspec. rails_12factorgem removed without replacement. All functionality was merged in rails itself.- Some gems were updated. Commit by commit. Before rails upgrade.
.with(consistency: :strong)was removed.mongoidgem deprecate them and remove support. We can use replacement to read from main mongo db. Did we really need this?- Replace
render text:withrender body:. - Remove
ActionController::RedirectBackError. This exception deprecated. - Replace
update_attributeswith justupdate.update_attributesis just long alias toupdate. redirect_to :backwas replaced withredirect_back fallback_location: root_pathWatcher#usershould be explicitly marked asoptional.autotest/discover.rbwas removed without replacement. I think, this is ancient relict.- Rails files was synced with rails 5.0.
- Add empty
public/apple-touch-icon-precomposed.pngto reduce error logs. - Add empty
public/apple-touch-icon.pngto reduce error logs. - Fix rails deprecations with positional arguments in tests. Like: before
get :show, id: app.idand afterget :show, params: { id: app.id }. - Rails 5.0 more strict about status code. You can't use
:error. You should exactly code like:internal_server_error. - Rails rename
serve_static_filestopublic_file_server.enabled. I left env nameErrbit::Config.serve_static_assets. - Rails configs were synced with rails defaults. With comments and other stuff inside.
- Sync
public/404.html,public/422.htmlandpublic/500.htmlwith rails 5.0. - Remove monkey-patch from
spec/spec_helper.rb - Fix deprecation in
add_on_blank(:resolved) - Fix
spec/requests/health_controller_spec.rb
Ok, it's time to talk about broken mongoid. Link to issue. Test suite pass, so.
I left:
# TODO: uncomment with new mongoid 6.2.x or later
# app.watchers.build(email: '[email protected]')
# app.save
with rails 5.1 should work properly.
P.S.: Running test suite generates a lot of warnings. This is not good, but... We can fix them later. :)
P.S.2: I update Dockerfile. And build image here.
@stevecrozz it is time to ask about code review.
A lot of deprecations. But, anyway, it's time to show and ask feedback.
I recommend to review this PR by commits. One commit per a time.
Next update will be with fixes for deprecations and upgrade omniauth and related gems.
Looks pretty good to me @biow0lf . Are you ready?
@stevecrozz I am ready. Let's merge and see.
🎉