なるようになるブログ

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

rails commit log流し読み(2017/06/21)

2017/06/21分のコミットです。

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

actionview/CHANGELOG.md

activerecord/CHANGELOG.md


[ci skip] Fixed the attribute name for event.detail

rails guideのWorking with JavaScript in Railsの修正です。

Rails-ujs event handlersの項、attribute名をタイポしていたのを修正しています。


Merge pull request #28833 from bogdanvlviv/add-test-cases-for-optimistic-locking

activerecord/lib/active_record/locking/optimistic.rbactiverecord/test/cases/locking_test.rbの修正です。

optimistic lockingに使用するカラムを任意の値に更新出来ない事を確認するテストを追加しています。


Merge pull request #29503 from savroff/fix_current_page_engine_issue

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

scopeまたはrails engine配下のページでcurrent_page?メソッドで正しく現在ページのチェックが出来ないバグがあったのを修正しています。

trailing slashのせいで正しく検知出来ていなかった為、request_uriのtrailing slashを削除し対応しています。


Shrink image files in the guides using ImageOptim

rails guideの修正です。

guide内で使用している画像をImageOptimを使用して圧縮しています。


Use bulk INSERT to insert fixtures

Active Recordの修正です。

fixturesを作成する際に、bulk INSERTを使用するよう修正しています。


Adds missing minor doc about tools/test.rb [ci skip]

tools/README.mdtools/test.rbの修正です。

tool/test.rbについての説明をREADMEに追記しています。


Fix destroy with locking_column value null

activerecord/lib/active_record/locking/optimistic.rbの修正です。

optimistic lockingを使用している、かつ、locking_columnnilの場合に、オブジェクトのdestryがエラーになってしまうバグがあったのを修正しています。


Fix ActiveRecord::Persistence#touch with locking

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

optimistic lockingを使用している、かつ、locking_columnにdefaultの値が設定されておらずnilの場合に、touchメソッドを呼び出した場合にエラーになってしまうバグがあったのを修正しています。


Fix call-seq typo s/==/<=>/ [ci skip]

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

ActiveModel::Name#<=>メソッドのdoc内でメソッド名をタイポしていたのを修正しています。


Avoid begin/rescue in fixture quoting

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

ConnectionAdapters::DatabaseStatements#with_yaml_fallbackメソッドで、YAML.dumpが必要かどうかを判定するのに、quoteメソッドを呼び出してTypeErrorが出るかどうかで判定していたのを、dump処理が必要な型(HashArray)でのみ明示的にYAML.dumpの呼び出しを行うようにし、不要なquote処理やエラーハンドリング処理を削除していまs.