Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent duplicate filters for encrypted attributes
When an Active Record encrypted attribute is declared, a filter for it is automatically added to `config.filter_parameters`. Prior to this commit, the filter would be re-added every time the model was reloaded: ```ruby class Post < ActiveRecord::Base encrypts :title end ``` ```irb irb> Rails.application.config.filter_parameters # => [:passw, ..., :ssn] irb> Post irb> Rails.application.config.filter_parameters # => [:passw, ..., :ssn, "post.title"] irb> reload! irb> Post irb> Rails.application.config.filter_parameters # => [:passw, ..., :ssn, "post.title", "post.title"] ``` This commit ensures filters are only added once so that `config.filter_parameters` does not grow unbounded.
- Loading branch information