scinote-web/app/services/team_zip_exporter.rb
Jure Grabnar 553ac4c360 Refactor code according to PR review
PR review: https://github.com/biosistemika/scinote-web/pull/1304

Closes: [SCI-2640], [SCI-2642], [SCI-2643], [SCI-2644].
2018-09-30 16:37:18 +02:00

19 lines
461 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,
:teams,
options
)
end
end