Is it possible to use multiple encryption keys for the same attribute in Rails 7?

Viewed 38

I know Rails 7 supports custom keys for each attr:

class Article < ApplicationRecord
  encrypts :summary, key_provider: ArticleKeyProvider.new
end

If we imagine here that an article belongs_to a user, I would like to use a different key per-user. Is this possible?

0 Answers
Related