2021/09/23分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
- PostgreSQL: support custom enum types
- Allow configuring Postgres password through the socket URL.
- Adds support for deferrable foreign key constraints in PostgreSQL.
activestorage/CHANGELOG.md
Fixed guide to case_sensitive
option for Activerecord uniqueness validator [skip ci]
activerecord/lib/active_record/validations/uniqueness.rb
のdoc、及び、rails guideのActive Record Validations
の修正です。
uniqueness validatorのcase_sensitive
オプションの挙動についての説明が実際の挙動と異なっていたのを修正しています。
docs: passwords are hashed, not "encrypted"
rails guideのSecuring Rails Applications
の修正です。
authlogic
やhas_secure_password
について説明している箇所で、encrypted
という言い方をしていたのをhashed
に修正しています。これらの機能ではパスワードを暗号化しているわけではない為。
Setup codespaces prebuild tasks
.github/workflows/codespaces.yml
の修正です。
codespacesの前処理用のactionを追加しています。
Fix codespaces precache action
.github/workflows/codespaces.yml
の修正です。
codespacesの前処理用action内のregionの指定方法が誤っていたのを修正しています。
PostgreSQL: support custom enum types
Active Recordの修正です。
PostgreSQLのcustom enum typeのサポートを追加しています。migrationファイルで、create_enum
でenumの定義を、t.enum
で定義したenumを使用出来るよう対応しています。
def up create_enum :mood, ["happy", "sad"] change_table :cats do |t| t.enum :current_mood, enum_type: "mood", default: "happy", null: false end end
なお、現在custom enum typeをサポートしているのはPostgreSQL adapterのみです。
Active Storage: incorrect defaults
Active Storageの修正です。
不正なcontent type(image/jpg
, image/pjpeg
, image/bmp
, text/javascript
)をサポートしていたのを、サポートしないよう修正しています。Rails 7.0では上記content typeが送信された場合サポートしなくなる旨deprecateメッセージが出力されるようになっており、7.1でサポートを削除する予定。
activerecord/lib/active_record/database_configurations/connection_url_resolver.rb
の修正です。
Postgresのpasswordをsocket URLに指定出来るよう修正しています。
Merge pull request #43280 from ryanfb/hidden_autocomplete_off
Action Viewの修正です。
hidden fieldsにautocomplete="off"
を指定するよう修正しています。Firefoxにhidden fieldsに勝手にランダムな値を設定してしまう、というバグがあり、autocomplete="off"
の指定があるとそのバグを防げる為。
参考: 520561 - Autocomplete is too aggressive and overwrites values of hidden fields.
Active Recordの修正です。
PostgreSQLのforeign keyにIMMEDIATE / DEFERRED modeを指定出来るよう修正しています。値はdeferrable
オプションで指定出来るようになっています。
add_foreign_key :aliases, :person, deferrable: :immediate