なるようになるブログ

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

rails commit log流し読み(2015/08/10)

2015/08/10分のコミットです。

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


[ci skip] Note that each action maps to a specific CRUD operation

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

CRUD, Verbs, and Actionsの項の言い回しを修正しています。


Reload I18n locales in development

ActiveSupport/railtiesの修正です。

development環境では、I18n.load_pathを自動でリロードするよう対応しています。

これにより、I18nファイルを新規に追加した際に、rails server の再起動無しでファイルが再読み込みされるようになります。 I18nファイルを大量に作成する必要があるようなサイトだと、ちょっと便利かも。


[ci skip] Note that each action maps to a specific CRUD operation

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

CRUD, Verbs, and Actionsの項の言い回しを修正しています。


push scope calls up one frame

actionpack/lib/action_dispatch/routing/mapper.rbの修正です。

shallow_scopeメソッドで行っていたscopeメソッドの呼び出し処理を削除し、代わりにブロックを実行出来るように、呼び出し元でscope呼び出し処理を定義するよう修正しています。

scopeメソッド呼び出し箇所を減らす為の修正との事です。


Whitespaces

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

不要な空白を削除しています。


Name the argument according with its job

actionpack/lib/action_dispatch/routing/mapper.rbの修正です。

Mapping#dispatcherメソッドの引数を適切な名前(defaults -> raise_on_name_error)に修正しています。


Execute the block when the controller doesn't exist

actionpack/lib/action_dispatch/routing/route_set.rbの修正です。

Dispatcher#controllerメソッドで、指定されたcontrollerが存在しない、かつraise設定がfalseの場合に、引数に指定されたブロックを実行するよう修正しています。

ブロックが実行されないことにより、テストがコケてしまっていたので、ブロックが実行されてなかったのは単純な対応漏れなようです。


Remove the conditional since it is done in the method

actionpack/lib/action_dispatch/routing/route_set.rbの修正です。

Dispatcher#controllerメソッドがブロック実行するように戻ったので、recognize_pathメソッドcontrollerメソッドを呼び出す際、ブロックを渡すようにし、不要な分岐処理を削除するよう修正しています。


Remove wrong comment

actionpack/lib/action_dispatch/routing/route_set.rbの修正です。

controllerメソッドの挙動について説明しているコメントが、実際の挙動と異なるようになってしまった為、削除しています。


Merge pull request #21176 from y-yagi/fix_scaffold_tests_inside_api_engine

railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rbの修正です。

Rails mountable engine + Rails APIを使用していた場合に、デフォルトで生成されるfunctional testが正常に動作していなかったのを、routesの設定及びfixtureに正しいpathを設定し、正常に動作するように修正しています。


Update Gemfile.lock

Gemfile.lockを最新の内容に更新しています。


docs, use hash instead of a string for order. [ci skip]

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

CRUD: Reading and Writing Dataの項、orderメソッドの引数にStringではなくHashを使用するよう修正しています。

-users = User.where(name: 'David', occupation: 'Code Artist').order('created_at DESC')
+users = User.where(name: 'David', occupation: 'Code Artist').order(created_at: :desc)

[ci skip] Modify introduction text and bullets to be consistent with other guides

rails guideのActive Model Basicsの修正です。

guideの冒頭部分、guideについて説明している箇所の言い回しを修正しています。