Db rollback fix
This commit is contained in:
parent
9011acc7a6
commit
acd81c3dd9
@ -97,7 +97,7 @@ class DmsfFile < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.storage_path
|
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?
|
if path.blank?
|
||||||
path = Pathname.new('files').join('dmsf').to_s
|
path = Pathname.new('files').join('dmsf').to_s
|
||||||
else
|
else
|
||||||
|
|||||||
@ -142,7 +142,11 @@ class DmsfFileRevision < ActiveRecord::Base
|
|||||||
|
|
||||||
def disk_file(search_if_not_exists = true)
|
def disk_file(search_if_not_exists = true)
|
||||||
path = self.storage_base_path
|
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)
|
filename = path.join(self.disk_filename)
|
||||||
if search_if_not_exists
|
if search_if_not_exists
|
||||||
unless File.exist?(filename)
|
unless File.exist?(filename)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user