mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
Create a concern for reflexes that handle Enterprise update
This commit is contained in:
12
app/reflexes/concerns/enterprise_concern.rb
Normal file
12
app/reflexes/concerns/enterprise_concern.rb
Normal 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
|
||||
Reference in New Issue
Block a user