Add team_id when asset is creating

This commit is contained in:
Urban Rotnik 2019-10-04 14:24:19 +02:00
parent 8176ce3a9d
commit 8f0c3bd2ce

View file

@ -198,7 +198,7 @@ class AssetsController < ApplicationController
render_403 && return unless %w(docx xlsx pptx).include?(params[:file_type])
# Asset validation
asset = Asset.new(created_by: current_user)
asset = Asset.new(created_by: current_user, team: current_team)
asset.file.attach(io: StringIO.new,
filename: "#{params[:file_name]}.#{params[:file_type]}",
content_type: wopi_content_type(params[:file_type]))