Db rollback fix
This commit is contained in:
parent
9011acc7a6
commit
acd81c3dd9
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user