2020/06/03分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- Add basic support for CHECK constraints to database migrations.
- Resolve issue with insert_all unique_by option when used with expression index.
has_attribute?
should be aware of attribute aliases
Active Recordの修正です。
has_attribute?
にattribute aliasesを指定した場合に正しくチェックが行われるよう修正しています。
Ensure column names on reflection as a string
Active Recordの修正です。
reflectionのcolumn nameを必ずStringとして管理するよう修正しています。Symbol -> Stringに変換する際のオブジェクト生成を避ける為。:
Support attribute aliases for type_for_attribute
activerecord/lib/active_record/model_schema.rb
、
activerecord/lib/active_record/relation.rb
の修正です。
type_for_attribute
にattribute aliasesを指定した場合に正しく処理が行われるよう修正しています。
BindParam
should not be passed to type_cast_for_database
Active Recordの修正です。
type_cast_for_database
のvalue引数にArel::Nodes::BindParam
が渡された場合の処理を削除しています。Arel::Nodes::BindParam
が渡される事は無い為。
Remove join_keys
and get_join_keys
activerecord/lib/active_record/associations/association_scope.rb
、
activerecord/lib/active_record/reflection.rb
の修正です。
join_keys
、get_join_keys
メソッドを削除し、ラップされていた`join_primary_key
、join_foreign_key
を直接呼び出すよう修正しています。
rails new --minimal gives you a minimal rails stack. (#39282)
railtiesの修正です。
rails new
に、最小のコンポーネントでRailsアプリケーションを作成する為の--minimal
オプションを追加しています。
このオプションを指定して作成したアプリケーションでは、Active Record、 Action Pack、 Action View、Active Support、 Railtiesのみが使われるようになっています。
Use Arel::Table#type_for_attribute
activerecord/lib/active_record/table_metadata.rb
、
activerecord/lib/active_record/type_caster/map.rb
の修正です。
TableMetadata
クラスで、typeを取得するのにArel::Table#type_cast_for_database
メソッドを使用するよう修正しています。
Alias direct_descendants as subclasses
activesupport/lib/active_support/descendants_tracker.rb
の修正です。
direct_descendants
のaliasとしてsubclasses
を定義して、Class#subclasses
が呼ばれた際にdirect_descendants
が動作するよう修正しています。
Add basic support for check constraints to database migrations
Active Recordの修正です。
database migrationにCHECK constraints用のメソッドを追加しています。
add_check_constraint :products, "price > 0", name: "price_check" remove_check_constraint :products, name: "price_check"
Replace 'Stubs out' with 'Generates' in generator USAGE's [ci skip]
各generatorのUSAGE内のStubs out
をGenerates
に変更しています。変更出来ず使用出来るファイルが生成される(一部)のにStubs out
という言い方をするのは混乱の元なのでは、という事で修正されています。
Fix issue with expression index in insert_all
activerecord/lib/active_record/insert_all.rb
の修正です。
insert_all
/ upsert_all
のunique_by
オプションに、expression indexを指定するとエラーになってしまうバグがあったのを修正しています。