We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I would like to be able to auto select the proper uploader based on a condition.
Exemple
class MyModel include ApplicationUploader::Attachment.new(:file) private def #{column_name}_dynamic_uploader if .... ImageUploader elsif ... VideoUploader else ... end end end
Right now it seems I am forced to define. multiple column based on the file type
Things I have tried
Overriding "#{column}_attacher" like so
"#{column}_attacher"
define_method(:"#{column}_attacher") do |**options| if respond_to?(:"#{column}_uploader_class", true) uploader_class = send(:"#{column}_uploader_class") uploader_class::Attacher.from_entity(self, column, **options) else super(**options) end end
For some reason, files don't persist when it doesn't go through the super(...) conditional branch.
super(...)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I would like to be able to auto select the proper uploader based on a condition.
Exemple
Right now it seems I am forced to define. multiple column based on the file type
Things I have tried
Overriding
"#{column}_attacher"
like soFor some reason, files don't persist when it doesn't go through the
super(...)
conditional branch.The text was updated successfully, but these errors were encountered: