2023/07/19分のコミットです。
CHANGELOGにのったコミットは以下の通りです。
Specify when to generate has_secure_token
activerecord/lib/active_record/secure_token.rb
の修正です。
has_secure_token
メソッドにtokenを生成するcallbackを指定出来るよう修正しています。デフォルトは:create
で、modelの初期化時にtokenを生成したい場合、on: :initialize
を指定すれば良いようになっています。
class User < ApplicationRecord has_secure_token on: :initialize end
Support include? and member? on composite primary key relations
activerecord/lib/active_record/relation/finder_methods.rb
の修正です。
composite primary keyを使用しているrelationに対するinclude?
とmember?
が動作するよう修正しています。