なるようになるブログ

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

rails commit log流し読み(2017/12/12)

2017/12/12分のコミットです。

CHANGELOGへの追加はありませんでした。


Return nil instead of false if raise Azure::Core::Http::HTTPError

activestorage/lib/active_storage/service/azure_storage_service.rbの修正です。

Service::AzureStorageService#deleteメソッドでblobの削除に失敗した場合に、falseを返していたのを、nilを返すよう修正しています。

他のサービス(GCSServiceS3Service)と挙動を合わせる為。


Invoke mogrify once when transforming an image

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

ActiveStorage::Variation#transformメソッドで複数オプションが指定された場合、指定された数だけImageMagickのコマンドが実行されていたのを、mogrifyが一度だけ実行されるよう修正しています。

が、後ほどrevertされています。


[ci skip] Update instrumentation guide for ActiveStorage

rails guideのActive Support Instrumentationの修正です。

service_delete_prefixed.active_storage hookについての説明を追加しています。


create_fixtures doesn't work since at least a94220b66c9e4890007f66b092b25f8a64a19d31:

railties/lib/rails/test_help.rbの修正です。

ActiveSupport::TestCase#create_fixturesメソッドを削除しています。

Rename "Fixtures" class to "FixtureSet"から動いておらず(クラス名の指定に誤りがあり、実行するとエラーになる)、そもそもTestCase classにcreate_fixturesメソッドは不要では、という事で削除されました。


Revert "Invoke mogrify once when transforming an image"

先ほどコミットされた、Invoke mogrify once when transforming an imageをrevertしています。

コミットログに説明が無いので詳細不明なのですが、期待通りに動作しなかった、とかですかねえ。


Fix optimizing GIF variants using mogrify's -layers option

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

再度mogrifyメソッドを使用するよう対応を行っています。

  def transform(image)
-    transformations.each do |(method, argument)|
-      if eligible_argument?(argument)
-        image.public_send(method, argument)
-      else
-        image.public_send(method)
+    transformations.each do |method, argument|
+      image.mogrify do |command|
+        if eligible_argument?(argument)
+          command.public_send(method, argument)
+        else
+          command.public_send(method)
+        end
       end

コミットログを見る限り、mogrifyの-layersオプションを使用出来るようにする為に対応したようです。多分。


[ci skip] Update routing guide for Direct

rails guideのRails Routing from the Outside Inの修正です。

directメソッド及びresolveメソッドについての説明を追加しています。


Fix secrets command deprecation message

railties/lib/rails/commands/secrets/secrets_command.rbの修正です。

bin/rails secrets:setupコマンドを実行した場合に表示するdeprecationメッセージ内の、credentialsコマンドのhelpの実行方法を修正しています。

-          say "bin/rails credentials --help"
+          say "bin/rails credentials:help"

オプション無しの--helpだと正しく動作しない為。


Prevent race condition when resetting time stubs

activesupport/lib/active_support/testing/time_helpers.rbの修正です。

Testing::SimpleStubs#unstub_objectメソッドでメソッドをunstubする際に、undef_methodメソッドを使用していたのをsilence_redefinition_of_methodメソッドを使用するよう修正しています。

スレッド間でunstubが競合した場合に、undef_methodメソッドだと実行タイミングによってundef済みのメソッドを再度undefしようとして、NoMethodErrorがraiseされてしまう為。


Enable Layout/SpaceBeforeComma rubocop rule, and fixed more

Layout/SpaceBeforeComma copを有効化、及び、各ファイルにcopを適応しています。


Remove stale comment about ActiveRecord::SchemaDumper.ignore_tables [skip ci]

rails guideのConfiguring Rails Applicationsの修正です。

ActiveRecord::SchemaDumper.ignore_tablesについて説明している箇所に、config.active_record.schema_formatrubyを指定している場合のみActiveRecord::SchemaDumper.ignore_tablesは使用される旨説明が記載されていたのですが、Respect 'SchemaDumper.ignore_tables' in databases structure dumpでschema formatにsqlを指定した場合も使用されるようになったので、不要な説明箇所を削除しています。


[ci skip] Fix Active Support Changelog about :race_condition_ttl

activesupport/CHANGELOG.mdの修正です。

Redis cache storeを追加した対応のエントリーでrace_condition_ttlrace_condition_toolにタイポしていたのを修正しています。