Carrierwave deprecation moving towards ActiveStorage through paperclip
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
# encoding: utf-8
|
||||
|
||||
class Dunlop::SourceFileUploader < CarrierWave::Uploader::Base
|
||||
if defined?(CarrierWave)
|
||||
class Dunlop::SourceFileUploader < CarrierWave::Uploader::Base
|
||||
|
||||
#storage :file
|
||||
#storage :file
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
File.join(
|
||||
Rails.application.config.file_storage_path,
|
||||
model.class.to_s.underscore,
|
||||
mounted_as.to_s,
|
||||
model.id.to_s
|
||||
)
|
||||
end
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
File.join(
|
||||
Rails.application.config.file_storage_path,
|
||||
model.class.to_s.underscore,
|
||||
mounted_as.to_s,
|
||||
model.id.to_s
|
||||
)
|
||||
end
|
||||
|
||||
def original_filename
|
||||
File.basename(path.to_s)
|
||||
def original_filename
|
||||
File.basename(path.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
# encoding: utf-8
|
||||
if defined?(CarrierWave)
|
||||
class Dunlop::TargetFileUploader < CarrierWave::Uploader::Base
|
||||
|
||||
class Dunlop::TargetFileUploader < CarrierWave::Uploader::Base
|
||||
storage :file
|
||||
|
||||
storage :file
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
File.join(
|
||||
Rails.application.config.file_storage_path,
|
||||
model.class.to_s.underscore,
|
||||
mounted_as.to_s,
|
||||
model.id.to_s
|
||||
)
|
||||
end
|
||||
|
||||
# Override the directory where uploaded files will be stored.
|
||||
# This is a sensible default for uploaders that are meant to be mounted:
|
||||
def store_dir
|
||||
File.join(
|
||||
Rails.application.config.file_storage_path,
|
||||
model.class.to_s.underscore,
|
||||
mounted_as.to_s,
|
||||
model.id.to_s
|
||||
)
|
||||
end
|
||||
|
||||
def original_filename
|
||||
File.basename(path.to_s)
|
||||
def original_filename
|
||||
File.basename(path.to_s)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user