2014/11/19分のコミットです。
CHANGELOGへの追加はありませんでした。
Ruby on Rails 3.0 Release Notes: fix broken link
rails guideのRuby on Rails 3.0 Release Notes
の修正です。
[Revamped Routes in Rails 3](https://medium.com/fusion-of-thoughts/revamped-routes-in-rails-3-b6d00654e5b0)
のリンクが変わっていたのを修正しています。 3.0のRelease Notes、まだ見てる人いるんですねえ。
Remove call to key?
in LazyAttributeHash#[]
activerecord/lib/active_record/attribute_set/builder.rb
の修正です。
LazyAttributeHash#[]
メソッドでkey?
メソッドの呼び出しを削除しています。
- if delegate_hash.key?(key) - delegate_hash[key] - else - assign_default_value(key) - end + delegate_hash[key] || assign_default_value(key)
性能改善対応。
activerecord/lib/active_record/attribute_set/builder.rb
の修正です。
LazyAttributeHash
クラスに:nodoc:
を指定しています。
Remove needless call to key?
when building attributes
activerecord/lib/active_record/attribute_set/builder.rb
の修正です。
LazyAttributeHash#assign_default_value
メソッドでkey?
メソッドの呼び出しを削除しています。
+ value_present = true + value = values.fetch(name) { value_present = false } - if values.key?(name) - delegate_hash[name] = Attribute.from_database(name, values[name], type) + if value_present + delegate_hash[name] = Attribute.from_database(name, value, typ
key?
でチェックするのではなく、fetch
メソッドで値の取得をしてるんですねえ。これも性能改善の為との事。
Make sure assert_select can assert body tag
Parse HTML as document fragmentの対応をrevertしています。
rails-dom-testingの方の変更に伴い、対応したようです。
Speed up integer casting from DB
activerecord/lib/active_record/type/integer.rb
の修正です。
Integer#type_cast_from_database
メソッドを追加しています。
元々cast_value
メソッドではrangeのチェック等を行っていたのですが、rangeチェック等は行わず、単純にto_i
でIntegerへの変換処理のみ行っています。こちらも性能改善の為との事。
pull the preloader allocation in to a factory method
activerecord/lib/active_record/relation.rb
の修正です。
preloader
の生成処理をメソッドに切り出していいます。
Improve the performance of reading attributes
ActiveRecordの修正です。
AttributeMethods::Read#_read_attribute
メソッドを追加しています。基本的にはread_attributes
メソッドと同じなのですが、こちらはprimary keyのチェックを行っておらず、その分高速なので、primary keyのチェックが不要な箇所ではこちらのメソッドを使用するよう修正しています。
actionview/test/template/date_helper_test.rb
の修正です。
test_select_time_with_custom_prompt
でselect_time
メソッドの引数に同じパラメータを2回設定してしまっていたので、片方削除しています。
Support symbol foreign key to delete
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
の修正です。
remove_foreign_key
メソッドのcolumnオプションにSymbolを指定した場合に、keyが削除されないバグがあったのを修正しています。columnオプションのStringへの変換処理が足りてなかったんですねえ。