なるようになるブログ

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

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

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

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


Merge pull request #25339 from prathamesh-sonpatki/reuse-validate-index-length

activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rbの修正です。

add_index_optionsメソッドでindex長のチェックを独自に行っていたのを、既存のvalidate_index_length!メソッドを使用するよう修正しています。


Example had results the wrong way round [ci skip]

rails guideのActive Record and PostgreSQLの修正です。

Database Viewsの項にあったexampleコードの実行結果が、実際の結果と異なっていたのを修正しています。


Merge pull request #25271 from kamipo/prevent_range_error_for_exists

Active Recordの修正です。

FinderMethods#exists?に不正な値(intより巨大な数字等)を指定した場合、RangeErrorがraiseされてしまっていたのを、必ずbooleanの値(エラーの場合false)を返すよう修正しています。


Fix digesting templates with identical logical names when requesting a format other than the first default

actionview/lib/action_view/digestor.rbの修正です。

template digestを作成する際に、keyにformatの情報も使用するよう修正しています。

app/views/api/todos/_todo.json.jbuilderapp/views/todos/_todo.html.erbというように、内部で扱われるpathが同じ(todos/_todo)でformatが違うようなtemplateの場合に、同じdigestが生成されてしまうバグがあった為。


Explicity find with the rendered format to handle searching multiple view paths correctly

actionview/lib/action_view/digestor.rbの修正です。

ActionView::PathSet#initializeに複数のview pathを渡した際に、ActionView::Digestor.treeメソッドでformatの情報を正しく取得出来るよう修正しています。が


Fix finding templates for digesting for / requests that render a non-default (html) template

actionview/lib/action_view/digestor.rbの修正です。

Accpet headerに*/*が指定された場合に、digestの計算時にhtml以外のformatのtemplateが含まれないバグがあったのを修正しています。


Move and rename test

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

test_different_formatstest_different_formats_with_same_logical_template_names_results_in_different_digestsにリネームしています。


Add test for nested html dependencies with same logical name as templates for other formats

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

同じlogical nameで違うformatのテンプレートがある時に、ActionView::Digestor.treeで正しいformatの値が取得出来る事を確認するテストを追加しています。


[ci skip] Remove duplicate alias documentation in ActiveModel::Validations

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

ActiveModel::Validations#valid?メソッドのdoc内に、validateメソッドのaliasである旨の説明が複数あったので、片方削除しています。