send attachment keys using ActiveResource
This commit is contained in:
@@ -15,8 +15,8 @@ class AppearanceReleaseImportsController < ApplicationController
|
||||
alert_message = t 'appearance_releases.create.no_attachments'
|
||||
redirect_to [@project, :appearance_releases], alert: alert_message
|
||||
else
|
||||
filtered_attachments = filter_attachments attachments
|
||||
MatchAppearanceReleasesJob.perform_later(@project, filtered_attachments)
|
||||
# filtered_attachments = filter_attachments attachments
|
||||
MatchAppearanceReleasesJob.perform_later(@project, attachments)
|
||||
notice_message = t 'appearance_releases.create.matching_started'
|
||||
redirect_to [@project, :appearance_releases], notice: notice_message
|
||||
end
|
||||
@@ -36,17 +36,6 @@ class AppearanceReleaseImportsController < ApplicationController
|
||||
params.require(:attachments)
|
||||
end
|
||||
|
||||
def filter_attachments(attachments)
|
||||
filtered_attachments = []
|
||||
attachments.each do |attachment|
|
||||
blob = ActiveStorage::Blob.find_signed attachment
|
||||
next if blob.nil?
|
||||
|
||||
extension = blob.filename.extension
|
||||
filtered_attachments << attachment if blob.image? || extension == 'pdf'
|
||||
end
|
||||
end
|
||||
|
||||
def acceptable_extensions
|
||||
AppearanceRelease.acceptable_import_file_extensions
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user