Db rollback fix

This commit is contained in:
Karel Picman 2018-03-13 13:21:54 +01:00
parent 9011acc7a6
commit acd81c3dd9
2 changed files with 6 additions and 2 deletions

View File

@ -97,7 +97,7 @@ class DmsfFile < ActiveRecord::Base
end
def self.storage_path
path = Setting.plugin_redmine_dmsf['dmsf_storage_directory']
path = Setting.plugin_redmine_dmsf['dmsf_storage_directory'].try(:strip)
if path.blank?
path = Pathname.new('files').join('dmsf').to_s
else

View File

@ -142,7 +142,11 @@ class DmsfFileRevision < ActiveRecord::Base
def disk_file(search_if_not_exists = true)
path = self.storage_base_path
FileUtils.mkdir_p(path) unless File.exist?(path)
begin
FileUtils.mkdir_p(path) unless File.exist?(path)
rescue StandardError => e
Rails.logger.error e.message
end
filename = path.join(self.disk_filename)
if search_if_not_exists
unless File.exist?(filename)