なるようになるブログ

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

rails commit log流し読み(2014/09/02)

2014/09/02分のコミットです。

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

activesupport/CHANGELOG.md


Use jquery-rails master

Gemfilerailties/lib/rails/generators/app_base.rbの修正です。

masterのjquery-railsを使用するよう修正しています。


Try with web-console master

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

masterのweb-consoleを使用するよう修正しています。


Remove warning

actionview/test/activerecord/polymorphic_routes_test.rbの修正です。

()が無くてwarningが出ていた箇所を修正しています。

-      assert_match /undefined method `series_url' for/, exception.message
+      assert_match(/undefined method `series_url' for/, exception.message)

Add test to assert the right sanitizer vendor is being used

Gemfilerailties/test/application/default_stack_test.rbの修正です。

masterのrails-html-sanitizerを使用するよう修正、及びsanitizer処理についてのテストを追加しています。


Move implementation to the gems

Gemfileactionview/lib/action_view/helpers/sanitize_helper.rbの修正です。

Gemfileにrails-deprecated_sanitizerの追加、及びそれに伴い不要となったメソッドの削除を行っています。


MySQL: skip GTID-unsafe statement tests when enforce_gtid_consistency is enabled

activerecord/test/cases/adapters/mysql2/schema_test.rbactiverecord/test/cases/helper.rbの修正です。

GTID(Global Transaction ID)が有効になっている場合、temporary tableをdropするテストを行わないよう対応しています。

GTID知らなかったのですが、MySQL 5.6.5からの新機能で、文字通りのトランザクションにグローバルなIDが付与する機能なんですね。これ使うと、マスターのポジション指定しなくてもレプリ組めるんですね。詳細はMySQLのdocご参考。


remove trailing whitespace. [ci skip]

activesupport/CHANGELOG.mdの修正です。

不要なスペースの削除。


Merge pull request #16450 from tgxworld/dont_swallow_error_when_identifying_constant_from_test_name

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

determine_constant_from_test_nameメソッドでクラス名生成するのに、constantizeメソッドを使用していたのを、safe_constantizeを使用するよう修正しています。

constantizeメソッドと、safe_constantizeの違いよく解ってなかったのですが、エラー発生時の処理が違うんですね。

'blargle'.safe_constantize    # => nil

'blargle'.constantize         # => NameError: wrong constant name blargle

元々の処理だと、constantizeメソッドを使用しるにも関わらず、NameErrorが発生した場合にエラー情報握りつぶしてしまっており、それで問題がおきていたようです。


[ci skip] Fix a typo in the doc of MessageDelivery

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

deliver_later!のrdocの説明がdeliver_laterになっていたのを修正しています。


ActiveJob: Implemented enqueue_at for QueueClassic

activejob/lib/active_job/queue_adapters/queue_classic_adapter.rbの修正です。

enqueueメソッド内で行っていたQC::Queueインスタンスの生成処理をbuild_queueメソッドに移動しています。

QC::Queueクラスのサブクラスを作成した場合、build_queueをオーバーライドして上げれば、任意のクラスで対応可能との事です。

具体的なケースとして、QueueClassicクラスはenqueue_atメソッドを実装してないのですが、実装欲しい場合は、自前で実装してねーという事のようです。また、実際それを対応している、 queue_classic-laterというgemがあるとの事です。


Leave all our tests as order_dependent! for now

各モジュールのabstract_unit.rbhelper.rbの修正です。

ランダムにテストを実行すると、まだエラーになってしまうようなので、ActiveSupport::TestCase.my_tests_are_order_dependent!を戻しています。


Merge pull request #16724 from seuros/testcase

ActiveJobのテストの修正です。

ActiveJobのテスト用のActiveJob::TestCaseクラス、テスト用のhelper等を新規に作成しています。


Add and Remove string/strip require

ConnectionAdaptersの修正です。

require 'active_support/core_ext/string/strip'の追加/削除をしています。