Skip to content

Suggestion: simplify resource directory structure #157

Description

@climatebrad

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})

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions