scinote-web/app/services/team_zip_exporter.rb

20 lines
461 B
Ruby
Raw Normal View History

module TeamZipExporter
def self.generate_zip(params, team, current_user)
Rails.logger.warn('Exporting team zip')
project_ids = params[:project_ids]
ids = Project.where(id: project_ids,
team_id: team)
2018-09-23 17:14:59 +08:00
.index_by(&:id)
2018-09-23 17:14:59 +08:00
options = { team: team }
zip = TeamZipExport.create(user: current_user)
zip.generate_exportable_zip(
current_user,
ids,
:teams,
options
)
end
end