Create a concern for reflexes that handle Enterprise update

This commit is contained in:
Jean-Baptiste Bellet
2023-03-16 15:14:09 +01:00
parent e3001cc8c4
commit bbec01a9cb

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
module EnterpriseConcern
extend ActiveSupport::Concern
included do
before_reflex do
@enterprise = Enterprise.find_by(permalink: params[:id])
authorize! :update, @enterprise
end
end
end