Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: simplify resource directory structure #157

Open
climatebrad opened this issue Sep 5, 2024 · 0 comments
Open

Suggestion: simplify resource directory structure #157

climatebrad opened this issue Sep 5, 2024 · 0 comments

Comments

@climatebrad
Copy link

It seems spurious to have resources saved at files/resource/{id} instead of simply files/{id}. Was the idea here that people can subclass Resource? (Even if they do, {id} will keep things unique.)
I recommend changing

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

to

def store_dir
  "files/#{model.id}"
end
in app/uploaders/resource_uploader.rb

(Alternatively, if the model name is kept, would make more sense to be at #{model.class.to_s.pluralize.underscore})

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

No branches or pull requests

1 participant