なるようになるブログ

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

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

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

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


Correct views mail method sends in API docs

actionmailer/lib/action_mailer/base.rbのdocの修正です。

htmlメールを送る際に使用するファイル名の説明に誤りがあったのを修正しています。


Don't default to YAML dumping when quoting values

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

ActiveRecordのserializeにJSONを指定した場合に、データをリード時にJSONパースエラーが起きてたのを対応しています。

quote処理で必ずYAML.dumpを行っていて、YAMLフォーマットになってしまっていたのが問題でした。


Go through normal where logic in destroy

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

relation_for_destroyの中で、ArelのASTを使用してActiveRecord_Relationを作成していたのを、普通のwhereメソッドを使用して作成するよう修正しています


Go through normal where logic in destroy with locking

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

relation_for_destroyの中で、ArelのASTを使用してActiveRecord_Relationを作成していたのを、普通のwhereメソッドを使用して作成するよう修正しています


Don't use the _before_type_cast version of attributes in the form

actionview/lib/action_view/helpers/tags/text_area.rbactionview/lib/action_view/helpers/tags/text_field.rbの修正です。

tagのrender用にvalueを取得する際に行っていた_before_type_castメソッドの呼び出しを、行わないよう修正しています。が、次のコミットで直ぐrevertされています。


Revert "Don't use the _before_type_cast version of attributes in the form"

先のvalue_before_type_cast処理をrevertしています。


Add tests with an explanation of why we're using _before_type_cast

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

before_type_castのテストを行っているテスト名を、何のテストをしているのか、より解りやすいものに修正しています。


Only use the _before_type_cast in the form when from user input

actionview/lib/action_view/helpers/tags/base.rbactiverecord/lib/active_record/attribute.rbの修正です。

ユーザがフォームで入力した値についてのみ_before_type_castを行うよう修正しています。

serializeを使用している場合に、serializeされたままデータがviewに表示されてしまう問題があり、その為の対応です。