action-center-platform
action-center-platform copied to clipboard
Rails 5.1
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. Usebefore_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
toMime[: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 useconfig.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 useconfig.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
String
s to be parsed as if they were inTime.zone
, andTime
s to be converted toTime.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
- It looks like we mostly use
-
render :text
is deprecated because it does not actually render atext/plain
response. Switch torender plain: 'plain text'
to render astext/plain
,render html: '<strong>HTML</strong>'
to render astext/html
, orrender body: 'raw'
to match the deprecated behavior and render with the default Content-Type, which istext/html
. (called fromsignature_count
at/opt/actioncenter/app/controllers/action_page_controller.rb:51
)