Sha256: c5256f63635ae58e1f93dfbc7cc318d993d8a44bc1b87e712fe9a334a8c5ac53
Contents?: true
Size: 663 Bytes
Versions: 73
Compression:
Stored size: 663 Bytes
Contents
class RailsOps::Operation::Model::Destroy < RailsOps::Operation::Model::Load model_authorization_action :destroy def model_authorization return unless authorization_enabled? unless load_model_authorization_action.nil? authorize_model_with_authorize_only! load_model_authorization_action, model end unless model_authorization_action.nil? authorize_model! model_authorization_action, model end end policy do if model.respond_to?(:deleteable?) && !model.deleteable? fail RailsOps::Exceptions::ModelNotDeleteable end end def perform trigger :before_destroy, model: model model.destroy! end end
Version data entries
73 entries across 73 versions & 1 rubygems