2014/07/30分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Get request should not write to database note added. [skip ci]
rails guideのRails Routing from the Outside In
の修正です。
GETメソッドはCSRF tokenのチェックをしないので、GETリクエストでDBに書き込むような処理をするな、という注意事項を追加しています。大事。
:nail_care: from #16329 [ci skip]
rails guideのRails Routing from the Outside In
の修正です。
先ほどのコミットについて、言い回しの修正、スペースの削除等を行っています。
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
eval_block
をprivateにしています。
only ask for the routes module once
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
routes.named_routes.module
の結果を変数に代入して、呼び出しを一回で済ますよう修正しています。
pass the module to define_named_route_methods
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
define_named_route_methods
メソッドの引数にmodule
を追加しています。これにより、@module削除出来る、との事なのですが、まだ使っているよな…。
helpers should be a Set so it doesn't grow unbounded
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
@helpers
のクラスをArrayからSetに変更しています。
so it doesn't grow unbounded
とコミットログにあるので、データが増えた際の事を考慮して、検索速度が早いSetに切り替えた、という事でしょうか。
ask the named routes collection if the route is defined
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
ルーティングが設定されているか確認する為のroute_defined?
メソッドを追加しています。
actionpack/lib/action_dispatch/routing/route_set.rb
の修正です。
先程追加されたroute_defined?
メソッドに誤りがあったのを修正しています。
- @module.method_defined? name + @helpers.include? name.to_sym
こんな感じで。
Add implicit receiver support to Object#with_options
activesupport/lib/active_support/core_ext/object/with_options.rb
の修正です。
Object#with_options
でreceiverが指定されなかった際の挙動が変更になっています。
# before class Account < ActiveRecord::Base with_options dependent: :destroy do |assoc| assoc.has_many :customers assoc.has_many :products assoc.has_many :invoices assoc.has_many :expenses end end
# after class Account < ActiveRecord::Base with_options dependent: :destroy do has_many :customers has_many :products has_many :invoices has_many :expenses end end
大分スッキリ書けるように。
Method#arity
で引数の数のチェックが出来る事を初めて知りました。
Merge pull request #15959 from aditya-kapoor/remove-unneeded-cases
activemodel/test/cases/validations_test.rb
の修正です。
使用してないテスト用のmodelを削除しています。
Revert "Merge pull request #15305 from tgxworld/remove_unnecessary_require"
こちらのコミットをrevertしています。
不要なrequire 'minitest'
を削除したコミットだったのですが、実は必要で、これがないとrails console上でapp
メソッドを呼び出すとエラーになってました。
require 'minitest'
を追加するPRを出していたのですが、Revertで対応が行われました。