Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Uploads folder is not generated #25

Open
dmunozvenegas opened this issue Jul 24, 2019 · 0 comments
Open

Uploads folder is not generated #25

dmunozvenegas opened this issue Jul 24, 2019 · 0 comments

Comments

@dmunozvenegas
Copy link

I have carrierwave-datamapper installed in my project.

ruby 2.0.0
rails 3.1.11

generate uploader file

class ArchivoUploader < CarrierWave::Uploader::Base

storage :file

def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end

def extension_white_list
%w(jpg jpeg gif png doc xls xlsx docx pdf txt zip rar ppt pptx)
end

I have my model

class MaterialAsignatura
include DataMapper::Resource
include DataMapper::Timestamps
include DataMapper::Historylog

storage_names[:default] = 'material_asignaturas'

property :id, Serial
timestamps :at
property :deleted_at, ParanoidDateTime
mount_uploader :source, ArchivoUploader

end

console output

SQL (0.186ms) BEGIN
SQL (1.542ms) INSERT INTO material_asignaturas (created_at, updated_at, source, seccion_dictada_id) VALUES ('2019-07-24 17:21:09', '2019-07-24 17:21:09', 'DIPLOMADO EN TIC.docx', 61784)
SQL (0.730ms) INSERT INTO historylogs (original_state, original_date, comment, historiable_type, historiable_id, created_at, updated_at) VALUES ('{"id":7,"created_at":"2019-07-24T17:21:09-04:00","updated_at":"2019-07-24T17:21:09-04:00","deleted_at":null,"source":{"url":"/uploads/material_asignatura/source/7/DIPLOMADO EN TIC.docx"},"seccion_dictada_id":61784}', '2019-07-24 17:21:09', 'Creado', 'MaterialAsignatura', 7, '2019-07-24 17:21:09', '2019-07-24 17:21:09')
default: commit
SQL (2.870ms) COMMIT

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant