なるようになるブログ

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

rails commit log流し読み(2018/01/29)

2018/01/29分のコミットです。

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

activerecord/CHANGELOG.md


Remove out-of-date references to jQuery

rails guideのThe Asset Pipelineの修正です。

jQueryがデフォルトで使用される旨説明が記載されている箇所があったのを修正しています。


Merge pull request #31811 from yahonda/supports_foreign_tables_in_abstract_adapter

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

AbstractAdaptersupports_foreign_tables?メソッドを定義しています。

テスト内でsupports_foreign_tables?メソッドでテストを実行するかチェックしている箇所があり、AbstractAdapterに定義されていないとMySQLSQLiteのテストを実行するとsupports_foreign_tables?メソッドが無い為エラーになってしまう為。


Merge pull request #31724 from orekyuu/fix-expand-composed-object-array

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

whereメソッドでcomposed_ofを使用しているカラムにArrayを指定した場合に、Arrayが正しく展開されないバグがあったのを修正しています


Remove joke in security guide [ci skip]

rails guideのSecuring Rails Applicationsの修正です。

CAPTCHAについて説明している箇所に、ジョーク? と思われる一文があったのを削除しています。

-The most simple negative CAPTCHA is one hidden honeypot field. On the server side, you will check the value of the field: If it contains any text, it must be a bot. Then, you can either ignore the post or return a positive result, but not saving the post to the database. This way the bot will be satisfied and moves on. You can do this with annoying users, too.
+The most simple negative CAPTCHA is one hidden honeypot field. On the server side, you will check the value of the field: If it contains any text, it must be a bot. Then, you can either ignore the post or return a positive result, but not saving the post to the database. This way the bot will be satisfied and moves on.

最後のYou can do this with annoying users, too.の箇所。


Add a test for ActiveStorage::Blob#image? and ActiveStorage::Blob#video?

activestorage/test/models/blob_test.rbの修正です。

ActiveStorage::Blob#image?メソッド、及び、ActiveStorage::Blob#video?メソッドのテストを追加しています。


Fix expanding an array of composed_of objects which have multiple mappings

Active Recordの修正です。

composed_ofmappingに複数の値を定義していた場合に、whereメソッドでcomposed_ofを使用しているカラムに指定した値が正しく展開されないバグがあったのを修正しています


Merge pull request #31615 from cben/type_for_attribute-symbol

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

type_for_attributeにStringしか指定出来なかったのを、Symbolも指定出来るよう修正しています。


Remove unused/missing to_money converter in the test/doc

activerecord/lib/active_record/aggregations.rbのdoc及びactiverecord/test/models/customer.rbの修正です。

composed_ofのテスト、docから使用していないconverterオプションを削除しています。


Revert "Merge pull request #23256 from pauloancheta/master"

composed_ofメソッドのdoc内ののmappingオプションに指定する値を修正した、 Merge pull request #23256 from pauloancheta/masterをrevertしています。元々記載されていた内容が正しかった為。


Extract discard_remaining_results for mysql2 adapter

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rbactiverecord/lib/active_record/connection_adapters/mysql/database_statements.rbの修正です。

結果セットを破棄する処理をメソッド(discard_remaining_results)に切り出しています。


Fix the example of 'finding records by a value object' (#31818)

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

composed_ofメソッドのdoc内に実際には動作しないexampleがあったのを修正しています。


Suppress expected exceptions by report_on_exception = false

activesupport/test/cache/behaviors/connection_pool_behavior.rbの修正です。

cache storeのテストでthreadで発生したexceptionのバックトレースが表示されていたのを、report_on_exceptionにfalseを指定して表示されないよう修正しています。


Deprecate expand_hash_conditions_for_aggregates

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

expand_hash_conditions_for_aggregatesメソッドをdeprecateにしています。

expand_hash_conditions_for_aggregatesメソッドではaggregated objectの配列を正しく展開出来ず、内部ではもう使用していない為。