なるようになるブログ

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

rails commit log流し読み(2018/07/22)

2018/07/22分のコミットです。

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

actionpack/CHANGELOG.md


Remove unused attribute

activestorage/lib/active_storage/attached.rbactivestorage/lib/active_storage/attached/model.rbの修正です。

ActiveStorage::Attachedクラスから使用していないdependent attributeを削除しています。


Merge pull request #33268 from benpickles/remove-pubdate-from-docs

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

time_tagメソッドのdocに、Bring Boolean Attributes list for AV Tags helper upto speed with curr… で削除されたpubdateを使用したexampleが残っていたのを削除しています。


Merge pull request #32984 from chiraggshah/min-thread-env-variable

railties/lib/rails/generators/rails/app/templates/config/puma.rb.ttの修正です。

config/puma.rbでpumaのスレッド数を指定する、max threadsしか環境変数で指定出来なかったのを、min threadsも環境変数で指定出来るよう修正しています。


Merge pull request #33409 from utilum/correct_epxectations_to_meet_minitest_strict_mocking

Active Recordのテストの修正です。

mock処理にmochaを使用していたのを、Rails内部のヘルパーメソッド(assert_calledassert_called_with)を使用するよう修正しています


Merge pull request #33403 from bogdanvlviv/clarify-test_notes_finds_notes_in_custom_directories

railties/test/application/rake/notes_test.rbの修正です。

rake notesを実行した場合にDEPRECATION WARNINGが表示されることを確認するテストを追加しています。


Add implicit to path conversion to uploaded file (#28676)

actionpack/lib/action_dispatch/http/upload.rbの修正です。

ActionDispatch::Http::UploadedFileクラスにto_pathメソッドを追加しています。実装はtempfileのto_pathメソッドを呼び出しているだけ。

これにより、ActionDispatch::Http::UploadedFileインスタンスを直接File.readに指定する事も出来るようなっています。

uploaded_file = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file)
File.read(uploaded_file)

[ci skip] Use consistent hash syntax in AR docs

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

.build / .createメソッドのexampleコードでHashの古い記法(:key => 'value')を使用していたのを、新しい記法(key: 'value')を使用するよう修正しています。

doc内で記法を統一する為。


[ci skip] Tidy up formatting of examples

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

add_indexメソッドのdoc内のexampleコードで、インデントがずれてexampleが正しく表示されない箇所があったのを修正しています。


Add render options in action_controller/renderer for api documentation [ci skip]

actionpack/lib/action_controller/renderer.rbのdocの修正です。

renderメソッドのdocに使用出来るオプションについての説明を追加しています。


[ci skip] fix typo in Associations guide

rails guideのActive Record Associationsの修正です。

Creating Join Tables for has_and_belongs_to_many Associationsの項で、class名をタイポしている箇所があったのを修正しています。