0
0
Fork 0

File cleanup/organization in controllers/concerns (#27846)

This commit is contained in:
Matt Jankowski 2023-11-30 09:39:41 -05:00 committed by GitHub
parent 0530ce5e95
commit 1f1c75bba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 26 additions and 26 deletions

View file

@ -1,33 +0,0 @@
# frozen_string_literal: true
module ExportControllerConcern
extend ActiveSupport::Concern
included do
before_action :authenticate_user!
before_action :load_export
skip_before_action :check_self_destruct!
skip_before_action :require_functional!
end
private
def load_export
@export = Export.new(current_account)
end
def send_export_file
respond_to do |format|
format.csv { send_data export_data, filename: export_filename }
end
end
def export_data
raise 'Override in controller'
end
def export_filename
"#{controller_name}.csv"
end
end