class Anony::Strategies::Destroy
The interface for configuring a destroy strategy. This strategy is not compatible with Anony::Strategies::Overwrite
.
@example
anonymise do destroy end
Public Instance Methods
apply(instance)
click to toggle source
Apply the Destroy
strategy to the model instance. In this case, it calls `#destroy!`.
@param [ActiveRecord::Base] instance An instance of the model
# File lib/anony/strategies/destroy.rb, line 33 def apply(instance) instance.destroy! Result.destroyed end
valid?()
click to toggle source
Whether the strategy is valid. This strategy takes no configuration, so valid?
always returns true
@return [true]
# File lib/anony/strategies/destroy.rb, line 17 def valid? true end
validate!()
click to toggle source
Whether the strategy is valid, raising an exception if not. This strategy takes no configuration, so validate!
always returns true
@return [true]
# File lib/anony/strategies/destroy.rb, line 25 def validate! true end