なるようになるブログ

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

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

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

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

actionpack/CHANGELOG.md


A few documentation edits [ci skip]

actionpack/lib/action_controller/api.rbactionpack/lib/action_controller/metal/params_wrapper.rbactiverecord/lib/active_record/enum.rbのdocの修正です。

タイポ、グラマー、RDocフォーマットの修正をまとめて行っています。


Merge pull request #20016 from steved/sdavidovitz/abort_if_pending

activerecord/lib/active_record/railties/databases.rakeの修正です。

abort_if_pending_migrationsタスクでload_configを読む込むよう修正しています。

-  task :abort_if_pending_migrations => :environment do
+  task :abort_if_pending_migrations => [:environment, :load_config] do

environmentだけだとapp配下のマイグレーションしか読み込まず、rails engineを使用していて、そこにpending migrationsがある場合に正常にabortしてくれていなかったので、修正したとの事です。


Merge pull request #20440 from repinel/fix-message-verifier-encoding-issue

activesupport/lib/active_support/message_verifier.rbの修正です。

ActiveSupport::MessageVerifie#verifyメソッドに不正なエンコードのデータを渡した際にinvalid byte sequenceでエラーになってしまっていたのを、他の不正な値を渡された場合同様に、nilを返すよう修正しています。


Merge pull request #20564 from repinel/fix-generators-named-base-template-doc

railties/lib/rails/generators/named_base.rbのdocの修正です。

Rails::Generators::NamedBase#templateメソッドのdocに、migrationファイルの生成の際に使われる旨記載があったのですが、実際は使われていないので、docの内容を最新の状態に更新しています。


Small refactor on db:reset https://github.com/rails/rails/commit/68f6d5346c4a0a3c6875939752ea116d507f0ba1

activerecord/lib/active_record/railties/databases.rakeの修正です。

resetタスクの中でdropタスク、setupタスクを呼びたしていたのを、dependencies taskの方に同タスクを定義するよう修正しています。

-  task :reset => [:environment, :load_config] do
-    db_namespace["drop"].invoke
-    db_namespace["setup"].invoke
-  end
+  task :reset => [ 'db:drop', 'db:setup' ]

document that default_url_options is cached per request [ci skip]

rails guideのAction Controller Overviewの修正です。

default_url_optionsについて説明している箇所に、生成されたURLはリクエスト毎にキャッシュされる旨説明を追加してます。


i18n guide: warn about default_url_options caching and locale selectors [ci skip]

rails guideのRails Internationalization (I18n) APIの修正です。

タイポの修正、及びこちらにもdefault_url_optionsで生成されたURLはリクエスト毎にキャッシュされる旨説明を追加しています。 locale selectorにも影響がある話なので、i18n guideの方にも説明を追加したようです。


Fix flakyness.

actionpack/test/controller/caching_test.rbの修正です。

cacheに関するテストの前処理で、cache_storeActiveSupport::Cache::MemoryStoreを設定しています。単純に設定漏れだったようです。


Merge pull request #20107 from ankit8898/av_refac_record_tag_helper

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

テストから、不要なinclude処理を削除しています。


Merge pull request #20257 from prathamesh-sonpatki/test-for-serial-for-quoted-sequence

activerecord/test/cases/primary_keys_test.rbの修正です。

シーケンス名がクォートされてなかった場合に、serial?メソッドが正しく動作するか確認する為のテストを追加しています。


Deprecate passing hash as first parameter into ActionController::Head

actionpack/lib/action_controller/metal/head.rbの修正です。

headメソッドの第一引数にHashを渡すのがdepreateになりました。

# before
head status: 406

# after
head 406

# これもOK
head :ok

元々第一引数にstatusやその他オプションもまとめて渡せるような状態になってしまっていたのを、ステータスとオプションを明確に別ける為に修正したようです。


Merge pull request #20108 from akshay-vishnoi/button-tag

actionview/lib/action_view/helpers/form_tag_helper.rbのdoc及び、 actionview/test/template/form_tag_helper_test.rbの修正です。

button_tagメソッドdisable_withを指定した場合のテストの追加、及びbutton_tagメソッドtypeオプションを指定した場合のexampleをdocに追加しています。


set the default charset in response initialize

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

responseのinitialize処理でdefault charsetを設定するよう対応しています。

rack response を作成する際、インスタンスを変更しないで済むように対応した、との事です。


remove header= on the response object.

actionpack/lib/action_dispatch/http/cache.rbactionpack/lib/action_dispatch/http/response.rbの修正です。

response objectから、header=メソッドを削除しています。

header objectは、webserverが設定するもので、ユーザが任意に値を設定するようなものでは無い為、セッターメソッドを削除したとの事です。