scinote-web/app/services/team_zip_exporter.rb
2018-10-14 23:56:10 +02:00

19 lines
460 B
Ruby

module TeamZipExporter
def self.generate_zip(params, team, current_user)
Rails.logger.info('Exporting team zip')
project_ids = params[:project_ids]
ids = Project.where(id: project_ids,
team_id: team)
.index_by(&:id)
options = { team: team }
zip = TeamZipExport.create(user: current_user)
zip.generate_exportable_zip(
current_user,
ids,
:team,
options
)
end
end