なるようになるブログ

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

rails commit log流し読み(2016/12/19)

2016/12/19分のコミットです。

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


Fix rake guides:generate:kindle error

guides/Rakefileguides/rails_guides/kindle.rbの修正です。

rails guideのkindle版生成処理が正しく動作していなかったのを修正しています。 update kindlerb gemで0.1系から1.0系に更新したのですが、1.0系にはbreaking changesがあり、その対応が行われていなかったため、動いていなかったとの事です。


Make attributes output in html opt-in.

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

form_withメソッドのoption解析処理で、optionに指定された値をそのままhtml attributesとして生成していたのを、メソッドで想定しているattributesのみ生成するよう修正しています。


[ci skip] Replace remote with local in form_with doc.

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

apply_form_for_optionsメソッドのdoc内のオプション名の説明に誤りがあったのを修正しています。


form_with: allow methods outside the model.

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

form_withに指定したmodelに存在しないメソッド名もfieldに指定出来るよう修正しています。


[ci skip] fields don't output ids by default anymore.

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

fieldsメソッド内のexampleにid属性が含まれていたのですが、デフォルトではid属性は出力されないようになったので、削除しています。


fields: support attributes not on model.

actionview/lib/action_view/helpers/form_helper.rbの修正です。fieldsメソッドに対して、先ほどのform_withの対応と同様にmodelに存在しないメソッド名もfieldに指定出来るよう修正しています。


Consolidate duplicated elsif branch

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

重複していた分岐処理を一つにまとめています。


protected here doesn't protect anything

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

I18n::Railtieクラスから不要なprotectedメソッドを削除しています。I18n::Railtieクラスにはインスタンスメソッドが無く、protectedの意味が無い為。


Merge pull request #27400 from kamipo/remove_useless_test_supports_primary_key

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

supports_primary_key?メソッドが呼び出せる事を確認するテストを削除しています。

supports_primary_key?メソッドはAbstractAdapter classに定義されており、どのadapterでもエラーになる事は無い為との事です。


Merge pull request #27388 from maclover7/jm-argv

railties/lib/rails/commands/generate/generate_command.rbの修正です。

Rails::Command::GenerateCommand#performメソッドで generatorをinvokeする前に、ARGV.shiftで先頭の引数(generator名)を削除しています。

元々削除するようになっていたのが、Initial Rails Commands Infrastructureの対応の際に削除されなくなってしまっていました。が、削除される事を期待しているgem等があった為、再度削除するようにしたとの事です。


Merge pull request #27365 from baweaver/patch-1

rails guideのRails Routing from the Outside Inの修正です。

Defining Defaultsの項に、defaultsメソッドにblockを渡した場合の挙動についての説明を追加しています。