设计为什么 sign_in_count 在 BLACKLIST_SERIALIZATION
Devise why sign_in_count in BLACKLIST_SERIALIZATION
我想知道为什么 :trackable 选项的 sign_in_count 和 current_sign_in_at 被设计列入黑名单,我知道 encrypted_password 被列入黑名单但 sign_in_count.
它们已添加到内部常量 BLACKLIST_FOR_SERIALIZATION
,以便为 Devise 模型提供更安全的默认值。
可以修改该数组以从黑名单中删除您需要的那些属性。
按照这个回答对here. Devise has BLACKLIST_FOR_SERIALIZATION
constant for this purpose. Check it in the source code: https://github.com/plataformatec/devise/blob/master/lib/devise/models/authenticatable.rb#L59
建议您不要根据设计贡献者之一的comment修改它。
我认为 BLACKLIST_FOR_SERIALIZATION
不应该被鼓励修改。它不是一个配置选项,而是一个内部常量,用于为 Devise 模型提供更安全的默认值。
我想知道为什么 :trackable 选项的 sign_in_count 和 current_sign_in_at 被设计列入黑名单,我知道 encrypted_password 被列入黑名单但 sign_in_count.
它们已添加到内部常量 BLACKLIST_FOR_SERIALIZATION
,以便为 Devise 模型提供更安全的默认值。
可以修改该数组以从黑名单中删除您需要的那些属性。
按照这个回答对here. Devise has BLACKLIST_FOR_SERIALIZATION
constant for this purpose. Check it in the source code: https://github.com/plataformatec/devise/blob/master/lib/devise/models/authenticatable.rb#L59
建议您不要根据设计贡献者之一的comment修改它。
我认为 BLACKLIST_FOR_SERIALIZATION
不应该被鼓励修改。它不是一个配置选项,而是一个内部常量,用于为 Devise 模型提供更安全的默认值。