Incomplete copy of a file to another project #651

This commit is contained in:
Karel Picman 2017-02-09 12:52:49 +01:00
parent 15a0c89eb4
commit 4e1072e8d2

View File

@ -276,7 +276,7 @@ class DmsfFile < ActiveRecord::Base
def copy_to(container, folder = nil)
project = container.is_a?(Project) ? container : container.project
# If the target project differs from the source project we must physically move the disk files
if self.project != project
if (self.project != project) && self.last_revision
if File.exist? self.last_revision.disk_file(self.project)
FileUtils.cp self.last_revision.disk_file(self.project), self.last_revision.disk_file(project)
end