なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2018/02/01)

2018/02/01分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


Swap encoded image width and height if angle is 90 or 270 degrees

activestorage/lib/active_storage/analyzer/image_analyzer.rbの修正です。

画像に角度が90度または270度であることを示すEXIFデータが含まれている場合、widthとheightの値を入れ替えるよう修正しています。


Consistent behavior for session and cookies with to_h and to_hash method

actionpack/lib/action_dispatch/middleware/cookies.rbactionpack/lib/action_dispatch/request/session.rbの修正です。

Sessionクラスにto_hashのaliasとしてto_hメソッドを、CookieJarクラスにto_hのaliasとしてto_hashメソッドを追加しています。

元々はSessionにはto_hashCookieJarにはto_hしかなかったのですが、紛らわしかったので、どちらも同じメソッドを使えるようにするためにaliasを追加しています。


Correct orientation detection

activestorage/lib/active_storage/analyzer/image_analyzer.rbの修正です。

先ほどのwidthとheightの入れ替え処理で、角度の取得処理に誤りがあったのを修正しています。


Update to latest rubies (2.2.9, 2.3.8 and 2.4.3) on Travis CI.

.travis.ymlの修正です。

CIで使用するRubyのバージョンを更新しています。


Use the full class name for the JSON coder, as there may be another

activestorage/app/models/active_storage/blob.rbの修正です。

ActiveStorage::BlobクラスでJSON coderを指定するのにフルクラス名を指定するようにしています。

-  store :metadata, accessors: [ :analyzed, :identified ], coder: JSON
+  store :metadata, accessors: [ :analyzed, :identified ], coder: ActiveRecord::Coders::JSON

JSONだけだと違うnamespaceのクラスが使用されてしまう事がある為。

representable で問題になっていたようです。Error while starting server with Rails 5.2.0.rc1


Add changelog entry for #31844

actionpack/CHANGELOG.mdの修正です。

先のsessionto_hメソッドを、CookieJarto_hashメソッドをそれぞれ追加した対応についてCHANGELOGにエントリーを追加しています。