2014/08/06分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Cleanup Transaction inheritance.
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
の修正です。
Transaction
クラスについてリファクタリングしています。
元々あったTransaction
のサブクラスを全て削除して、必要なクラスのみ再度定義しています。
Moved #create! method from Validations to Persistence module
activerecord/lib/active_record/persistence.rb
の修正です。
#create!
メソッドをValidations
クラスからPersistence
クラスに移動しています。
save
、save!
、create
がPersistence
に定義されているのに、create!
だけValidations
にあるのおかしくない? という事で修正したようです。
Add after_bundle to the release notes and upgrade guide
rails guideのA Guide for Upgrading Ruby on Rails
の修正です。
after_bundle
についての説明を追加しています。
管理しているファイルを全てバージョン管理化に追加する処理をApplication templateを設定していた場合に、エラーが発生してしまう場合があります。
以下サンプル。
# template.rb generate(:scaffold, "person name:string") route "root to: 'people#index'" rake("db:migrate") git :init git add: "." git commit: %Q{ -m 'Initial commit' }
これはbinstub実行前にgit init / adddが実行されてしまい、binstubにより生成されたファイルがバージョン管理に追加されないので、エラーになってしまうようです。
で、その為の対応として、after_bundle
というcall backが追加されています。
以下修正したサンプル。
# template.rb generate(:scaffold, "person name:string") route "root to: 'people#index'" rake("db:migrate") after_bundle do git :init git add: "." git commit: %Q{ -m 'Initial commit' } end
これで大丈夫。
railties/test/application/middleware_test.rb
の修正です。
Rack::ETag
がdigestの前にW/
を含むようになったので、rails側のテストも同夜に修正しています。
ETagには、強いETag値と弱いETag値があり、弱いETag値は先頭にW/
がつくんですね。知らなかった。詳細はwiki参照。
We don't need parenthesis for this
railties/test/application/middleware_test.rb
の修正です。
不要な丸括弧を削除しています。
just assign the instance variables on the test
actionpack/test/dispatch/prefix_generation_test.rb
の修正です。
テストに使用するインスンタンス変数をsetup
内で設定するよう対応しています。
no reason to lazily instantiate the routes
actionpack/test/dispatch/prefix_generation_test.rb
の修正です。
routes
の生成処理をクラスメソッドにしていたのを止めて、クラスロード時に処理が行われるよう修正しています。
a rails application should be an engine subclass
actionpack/test/dispatch/prefix_generation_test.rb
の修正です。
RailsApplication
の親クラスにRails::Engine
を設定しています。
call the routes method on engines
actionpack/test/dispatch/prefix_generation_test.rb
の修正です。
routes
の生成処理を再度修正しています。Rails::Engine
のroutes
メソッドを呼び出して対応するように修正しています。
schema rake tasks are specific about the configuration to act on.
ActiveRecordのdatabase taskの修正です。
load schemaを行う際、configuration
を指定出来るようにしたActiveRecord::Tasks::DatabaseTasks.load_schema_for
メソッドを追加しています。
最終的には、ActiveRecord::Tasks::DatabaseTasks.load_schema_for
をActiveRecord::Tasks::DatabaseTasks.load_schema
に名前を変更したいとの事で、現状のload_schema
はdeprecateになりました。
現状のload_schema
相当のメソッドが必要な場合、ActiveRecord::Tasks::DatabaseTasks.load_schema_current
を使用するようにとの事です。
Merge pull request #16402 from bogdan/select_with_empty_block
actionview/lib/action_view/helpers/tags/select.rb
の修正です。
select
タグに空のブロックを渡した際、htmlの出力を行わないよう対応しています。
サンプル。
= form.select(:campaign_id) do - available_campaigns.each do |c| %option{value: c.id}= c.name
ここでavailable_campaigns
がnilだった場合にエラーが発生していたのですが、エラーが起きないよう対応されています。