なるようになるブログ

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

rails commit log流し読み(2016/05/06)

2016/05/06分のコミットです。

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

actionpack/CHANGELOG.md


[ci skip] Don't promote SQL interpolation.

activerecord/lib/active_record/callbacks.rbのdocの修正です。

ActiveRecord::Callbacks moduleのdoc内のexampleで、whereメソッドで値を指定するのに、プレースホルダを使用していなかったのを、プレースホルダを使用するよう修正しています。


Move protected instance variable to the right place

actionpack/lib/abstract_controller/rendering.rbactionpack/lib/action_controller/base.rbの修正です。

AbsctractController::Rendering::DEFAULT_PROTECTED_INSTANCE_VARIABLESでrender処理だけではなく、Action Controller / Action View共通対象となるprotected instance variableが定義されていたのを、ActionController::Base::DEFAULT_PROTECTED_INSTANCE_VARIABLESで定義するよう修正しています。


delegate encode_with instead of to_yaml, which is deprecated

activerecord/lib/active_record/relation/delegation.rbの修正です。

recordsto_yamldelegateしていたのを、encode_withdelegateするよう修正してます。to_yamlはdeprecatedになっている為。


Change to use a more realistic example and not giving the impression that destroy_all is preferred way to destroy related records.

activerecord/lib/active_record/callbacks.rbのdocの修正です。

ActiveRecord::Callbacks moduleのdoc内のexampleで、callbacks処理のexampleでdestroy_allを使用していたのを、update_allを使用するよう修正しています。 destroy_allをしたいならassociationのdependentオプションを指定すれば良く、exampleとして不適切だろうという事で修正したようです。


Implement helpers proxy in controller instance level

actionpack/lib/action_controller/base.rbactionpack/lib/action_controller/metal/helpers.rbの修正です。

controllerのインスタンスからhelper methodを呼び出せるよう修正しています。

module UserHelper
  def my_user_helper
    # ...
  end
end

class UsersController < ApplicationController
  def index
    render inline: helpers.my_user_helper
  end
end

Merge pull request #24806 from vipulnsward/errors-details-test

activemodel/test/cases/errors_test.rbの修正です。

ActiveModel::Errorsのテストで、テストでエラーを追加する際に、何によるエラーかのラベルも追加するよう修正しています。


Active Model: Improve CHANGELOG and documentation for validates_acceptance_of [ci skip]

activemodel/CHANGELOG.mdguides/source/active_record_validations.mdの修正です。

validates_acceptance_ofのデフォルトを"1"から、"1"とtrueに修正した対応(allow '1' or true for acceptance validation. by mokhan · Pull Request #18439 · rails/rails)のentryについて、より詳細な説明を追加、及びrails guideのacceptanceオプションについて説明している箇所に、更新内容を反映しています。


Merge pull request #24589 from vipulnsward/am-fragment-cache

actionmailer/test/caching_test.rbの修正です。

fragment cachingのテストに、各種オプションを指定した場合、multipartのファイルをキャッシュした場合のテスト等を追加しています。


Release notes: Add PR #24866 to release notes

rails guideのRuby on Rails 5.0 Release Notesの修正です。

先ほどのcontrollerのインスタンスからhelper methodを呼び出せるようにした対応について、Release Notesにentryを追加しています。


Fix markdown syntax in 'Ruby on Rails 2.2 Release Notes' [ci skip]

rails guideのRuby on Rails 2.2 Release Notesの修正です。

Advogato: Blog for fxnへのリンクが壊れてしまっていたのを修正しています。


Fix link in 'Ruby on Rails 3.0 Release Notes' [ci skip]

rails guideのRuby on Rails 3.0 Release Notesの修正です。

Bundler へのリンクが壊れてしまっていたのを修正しています。