Rails (OSS) パッチ会 #5

Rails 5.1.0 (現在 beta1) にアップグレードする際の警告ログについて見てたりしていた。

いまのところ以下の2つの変更に伴う警告ログが、ログ川の双璧になりうる印象。

Deprecate implicit coercion of ActiveSupport::Duration

github.com

出力されるログは以下。

DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2.

2017年3月16日追記

https://github.com/rails/rails/pull/28425 でこちらの警告ログの川は消えていた。

Deprecate the behavior of AR::Dirty inside of after_(create|update|save) callbacks

github.com

こちらの出力されるログの例。

DEPRECATION WARNING: The behavior of `attribute_changed?` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute?` instead.

アプリケーションに限らず依存 Gem でも出力されるものなので、CarrierWave に出ている PR のように見かけた警告を消して行けるとよさそう。