Module: Anony::Anonymisable
- Defined in:
- lib/anony/anonymisable.rb
Overview
The main Anony object to include in your ActiveRecord class.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#anonymise! ⇒ Anony::Result
Run all anonymisation strategies on the model instance before saving it.
Instance Method Details
#anonymise! ⇒ Anony::Result
Run all anonymisation strategies on the model instance before saving it.
66 67 68 69 70 71 72 73 |
# File 'lib/anony/anonymisable.rb', line 66 def anonymise! raise ArgumentError, ".anonymise not yet invoked" unless self.class.anonymise_config self.class.anonymise_config.validate! self.class.anonymise_config.apply(self) rescue ActiveRecord::RecordNotSaved, ActiveRecord::RecordNotDestroyed => e Result.failed(e) end |