action-center-platform icon indicating copy to clipboard operation
action-center-platform copied to clipboard

Rails 5.1

Open esoterik opened this issue 5 years ago • 0 comments

There are currently a decent number of deprecations that will cause things to break when we upgrade to Rails 5.1, as well as some changes in behavior. Here's the list of deprecations and warnings for reference:

  • before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from <top (required)> at /opt/actioncenter/config/environment.rb:5) -- I suspect that this is called in a gem because we don't have any calls to it in our app code
  • Accessing mime types via constants is deprecated. Please change Mime::JSON to Mime[:json]. (called from <top (required)> at /opt/actioncenter/config/application.rb:7)
  • config.serve_static_files is deprecated and will be removed in Rails 5.1. Please use config.public_file_server.enabled = true instead. (called from block in <top (required)> at /opt/actioncenter/config/environments/test.rb:16)
  • config.static_cache_control is deprecated and will be removed in Rails 5.1. Please use config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' } instead. (called from block in <top (required)> at /opt/actioncenter/config/environments/test.rb:17)
  • ActiveRecord::Base.raise_in_transactional_callbacks= is deprecated, has no effect and will be removed without replacement. (called from <top (required)> at /opt/actioncenter/config/environment.rb:5)
  • Directly inheriting from ActiveRecord::Migration is deprecated -- this affects many old migrations
  • Time columns will become time zone aware in Rails 5.1. This still causes Strings to be parsed as if they were in Time.zone, and Times to be converted to Time.zone. To keep the old behavior, you must add the following to your initializer: config.active_record.time_zone_aware_types = [:datetime] To use the new behavior, add the following: config.active_record.time_zone_aware_types = [:datetime, :time]
    • It looks like we mostly use Time.zone but I want to flag this as potentially requiring a DB migration to get time zone right for existing data
  • render :text is deprecated because it does not actually render a text/plain response. Switch to render plain: 'plain text' to render as text/plain, render html: '<strong>HTML</strong>' to render as text/html, or render body: 'raw' to match the deprecated behavior and render with the default Content-Type, which is text/html. (called from signature_count at /opt/actioncenter/app/controllers/action_page_controller.rb:51)

esoterik avatar May 22 '19 20:05 esoterik