なるようになるブログ

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

rails commit log流し読み(2015/07/01)

2015/07/01分のコミットです。

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

activerecord/CHANGELOG.md


Correct through associations using scopes

activerecord/lib/active_record/associations/association_scope.rbactiverecord/lib/active_record/associations/through_association.rbの修正です。

through associations + scopeを使用した場合に、scopeが複数回マージされてしまい、ただしく処理が行われないバグがあったのを修正しています。 ReflectionProxy#add_constraintsメソッドunscope!を呼び出す事で対応しています。

Rails 4.2.3で入ってしまったリグレッションです。 詳細は、Rails 4.2.3 regression on unscoped belongs_toActiveRecord 4.2.3 regression on has_many :through association 辺りをご参照。


Avoid crashing when minitest-rails is loaded.

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

plugin_rails_initメソッドの中で、Rails定数を参照する際、絶対パスで読み込むよう修正しています。

-      Minitest.backtrace_filter = Rails.backtrace_cleaner if Rails.respond_to?(:backtrace_cleaner)
+      Minitest.backtrace_filter = ::Rails.backtrace_cleaner if ::Rails.respond_to?(:backtrace_cleaner)

minitest-rails gem を一緒に使用した場合に、定数がバッティングしてしまって、エラーになってしまっていたので対応したとの事です。


Separate the constraint and other options [ci skip]

activemodel/lib/active_model/validations/length.rbのdocの修正です。

length validationのオプションの説明について、制約に関するオプションとそれ以外のオプションとで説明を分けています。