なるようになるブログ

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

rails commit log流し読み(2017/01/30)

2017/01/30分のコミットです。

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


Report the attribute on ActiveRecord::SerializationTypeMismatch

Active Recordの修正です。

ActiveRecord::SerializationTypeMismatchエラーのエラーメッセージに、エラーになったattribute名を含むよう修正しています。


Ruby constant look-up no longer falls back to top-level since 2.5

activesupport/test/dependencies_test.rbの修正です。

Dependencies moduleのテストで、トップレベルの定数が参照される事により通らないテストがあったのを、Ruby 2.5の場合のみテストが実行されるよう修正してます。

-  def failing_test_access_thru_and_upwards_fails
-    with_autoloading_fixtures do
-      assert_not defined?(ModuleFolder)
-      assert_raise(NameError) { ModuleFolder::Object }
-      assert_raise(NameError) { ModuleFolder::NestedClass::Object }
+  # This raises only on 2.5.. (warns on ..2.4)
+  if RUBY_VERSION > "2.5"
+    def test_access_thru_and_upwards_fails
+      with_autoloading_fixtures do
+        assert_not defined?(ModuleFolder)
+        assert_raise(NameError) { ModuleFolder::Object }
+        assert_raise(NameError) { ModuleFolder::NestedClass::Object }
+      end

Ruby 2.5からトップレベルの定数は参照されなくなる為。


Improve insufficient test for safe_join

actionview/test/template/output_safety_helper_test.rbの修正です。

safe_joinのテストに$,に値を指定した場合のテストを追加しています。


Make assert_enqueued_emails + assert_no_enqueued_emails consider parameterized delivery jobs

actionmailer/lib/action_mailer/test_helper.rbの修正です。

assert_enqueued_emailsassert_no_enqueued_emailsメソッドでparameterized moduleを使用したmailerもチェック出来るよう修正しています。

    def assert_enqueued_emails(number, &block)
-      assert_enqueued_jobs number, only: ActionMailer::DeliveryJob, &block
+      assert_enqueued_jobs number, only: [ ActionMailer::DeliveryJob, ActionMailer::Parameterized::DeliveryJob ], &block
     end