2014/12/27分のコミットです。
CHANGELOGへの追加はありませんでした。
Update guides regarding the extension changes
Rails Guideの修正です。
coffee、scssのexampleからそれぞれjs、cssの拡張子を削除しています。
以前にも書きましたが、それぞれ、coffee-rails、sass-railsの変更による影響です。
Correctly ignore case_sensitive
for UUID uniqueness validation
ActiveRecordのConnectionAdaptersの修正です。
UUID型のカラムにuniqueness validation + case_sensitive
オプションを設定した場合に、case_sensitive
の設定を無視するよう対応しています。
本来、UUID型はデフォルトでcase insensitive なので、case_sensitive
のオプションを設定するのはそもそも不要そうなのですが、4.1系の挙動に合わせる為、動作するよう修正したようです。
Propagate frozen state during transaction changes
activerecord/lib/active_record/transactions.rb
の修正です。
transactions処理中に、frozen
状態の管理に誤りがあり、Rollback時に"Can't modify frozen hash"エラーが発生するケースがあったのを対応しています。
テストコードより。
topic = Topic.create reply = topic.replies.create Topic.transaction do topic.destroy # calls #destroy on reply (since dependent: destroy) reply.destroy raise ActiveRecord::Rollback #=> ここで "Can't modify frozen hash"が起きてしまっていた end
Remove unused @relation
instance variable
activerecord/lib/active_record/model_schema.rb
の修正です。
使用していない@relation
変数を削除しています。
Inject the PredicateBuilder
into the Relation
instance
ActiveRecordの修正です。
Relation
クラスのコンストラクタにの引数に PredicateBuilder
を追加しています。
PredicateBuilder
の生成処理を一度に済ませる為の、リファクタリング、ですかねえ…。
activerecord/lib/active_record/relation/predicate_builder/array_handler.rb
の修正です。
:nodoc:
を追加しています。
Change PredicateBuilder
handler methods to instance methods
https://github.com/rails/rails/commit/a3936bbe21f4bff8247f890cacfd0fc882921003
ActiveRecordの修正です。
PredicateBuilder
のhanlder用のクラスを新規に作成し、handle処理をそちらのクラスで行うよう修正しています。
Re-use the predicate builder in the ArrayHandler
activerecord/lib/active_record/relation/predicate_builder.rb
activerecord/lib/active_record/relation/predicate_builder/array_handler.rb
の修正です。
ArrayHandler
のコンストラクタの引数にPredicateBuilder
クラスを渡せるようにし、PredicateBuilder
を使いまわせるよう修正しています。
Refactor association handling in PredicateBuilder
activerecord/lib/active_record/relation/predicate_builder.rb
の修正です。
expand
の中で行っていたassociationに関するQueryの生成処理を、
新規に作成したPredicateBuilder::AssociationQueryHandler
、PredicateBuilder::AssociationQueryValue
クラスで行うようリファクタリングしています。
activerecord/test/cases/relation/mutation_test.rb
の修正です。
relation
-> @relation
に修正しています。
Ruby 2.2でwarningが出たのでその対応との事です。何のwarningだろう。
Remove klass
and arel_table
as a dependency of PredicateBuilder
ActiveRecordの修正です。
PredicateBuilder
クラスから、klass
、arel_table
を削除しています。代わりに、メタ情報を保持する為のTableMetadata
クラスを新規に作成し、そちらで必要な情報保持するよう修正しています。
Perform casting of single values within the predicate builder
ActiveRecordの修正です。
単一値のキャスト処理をpredicate builderの中で行うよう修正しています。
Eagerly cast range values in the predicate builder
activerecord/lib/active_record/relation/predicate_builder/range_handler.rb
の修正です。
PredicateBuilder
の中でcastした値を取得するよう修正しています。
Arel側の変更に合わせて修正しているようです。
Eagerly cast array values passed to the predicate builder
activerecord/lib/active_record/relation/predicate_builder/array_handler.rb
の修正です。
今度はPredicateBuilder
のArrayHandler
でcastした値を取得するよう修正しています。
Arelからtype cast処理を削除する為のリファクタリングのいっかんとの事です。
Go through normal where
logic when preloading associations
activerecord/lib/active_record/associations/preloader/association.rb
の修正です。
associationをpreloading済みの場合に生成されるSQLを"in"から"="に修正しています。
Developer.where(:id => 1).includes(:audit_logs).explain # before EXPLAIN for: SELECT `audit_logs`.* FROM `audit_logs` WHERE `audit_logs`.`developer_id` IN (1) # after EXPLAIN for: SELECT `audit_logs`.* FROM `audit_logs` WHERE `audit_logs`.`developer_id` = 1)
We don't need to perform type casting on the STI condition
activerecord/lib/active_record/inheritance.rb
の修正です。
type_condition
メソッドにArel::Nodes::Quoted
の値のラップ処理を追加しています。
Arelからtype cast処理を削除する為のリファクタリングのいっかんですかねえ。
因みに、このそのラップ処理もRails 5.1で削除予定との事。
We don't need to cast the value a second time in uniqueness validations
activerecord/lib/active_record/validations/uniqueness.rb
の修正です。
build_relation
メソッドでArel::Nodes::Quoted
での値のラップ処理を追加しています。
Arelからtype cast処理を削除する為のリファクタリングの一環。
Go through normal where
logic in uniqueness validation
activerecord/lib/active_record/validations/uniqueness.rb
の修正です。
Arelのtableを使っている箇所をメソッドを使用するよう修正したり、諸々細かい箇所のリファクタリングを行っています。
Fall back to type casting from the connection adapter
activerecord/lib/active_record/table_metadata.rb
の修正です。
TableMetadata::ConnectionAdapterTable
クラスを作成し、 connection adapterから取得した値のcast処理をそのちらのクラスで行うよう修正しています。
We don't need to type cast the offset in find_in_batches
activerecord/lib/active_record/relation/batches.rb
の修正です。
Arel::Nodes::Quoted
での値のラップ処理を追加しています。
Inform Arel that we don't need to cast a value in tests
activerecord/test/cases/scoping/default_scoping_test.rb
の修正です。
Arelのメソッドを呼び出してテストを行っている箇所に、Arel::Nodes::Quoted
での値のラップ処理を追加しています。
Go through normal where logic in apply_join_dependency
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
Arel::Table
を使用している箇所を、使用しない形に修正しています。
Inform Arel that we don't need type casting in tests
activerecord/test/cases/relation_test.rb
の修正です。
Arelのメソッドを呼び出してテストを行っている箇所に、Arel::Nodes::Quoted
での値のラップ処理を追加しています。
We don't need additional type casting for locking updates
activerecord/lib/active_record/locking/optimistic.rb
の修正です。
Arel::Nodes::Quoted
での値のラップ処理を追加しています。
Go through normal update_all
logic when updating counter caches
activerecord/lib/active_record/counter_cache.rb
の修正です。
Arel::Table
を使用している箇所を、使用しない形に修正しています。
Go through normal update_all
logic when updating lock columns
activerecord/lib/active_record/locking/optimistic.rb
の修正です。
_update_record
メソッドでArel::Table
を使用して処理を行っていたのを、update_all
を使用するようリファクタリングしています。
Inform Arel that we don't need additional type casting in batching
activerecord/lib/active_record/relation/batches.rb
の修正です。
find_in_batches
メソッドにArel::Nodes::Quoted
での値のラップ処理を追加しています。
Inform Arel we don't need additional type casting in batches
activerecord/lib/active_record/relation/batches.rb
の修正です。
find_each
メソッドにArel::Nodes::Quoted
での値のラップ処理を追加しています。
Inform Arel we don't need additional type casting in tests
activerecord/test/cases/relation/merging_test.rb
、
activerecord/test/cases/relation/where_chain_test.rb
、
activerecord/test/models/author.rb
の修正です。
Arelのメソッドを呼び出してテストを行っている箇所に、Arel::Nodes::Quoted
での値のラップ処理を追加しています。
Refactor PostgreSQL::TableDefinition#primary_key
activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb
の修正です。
primary_key
メソッドのリファクタリングを行っています。
Add a note about non-buffering servers for AC::Live
rails guideのAction Controller Overview
の修正です。
Live Streaming of Arbitrary Data
の項に、WEBrickではActionController::Liveが使えない旨と、ActionController::Liveが使用出来るバッファリングしないAPサーバ(Puma/Rainbows等)についての情報を追記しています。