-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Attachment adapters #3237
Attachment adapters #3237
Conversation
It's good practice not to define methods on Object, even if the method name was unique enough not to be in conflict with anything. Also changed the constant to reflect the actual content (Rails 5.2+) rather than a consequence of it, that allowed reusing it in more places.
d5b7604
to
d387a72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elia I think this is a great improvement, thank you!
I left one comment, it is blocking as I think there's a bug.
Also, I am thinking about whether it may be worth documenting the ability to change the image uploads gem within the guides, as this feature may have a strong appeal to many devs, what do you think?
Again, thank you for your continuous work in trying to improve Solidus image uploads 🖼
I've tested this PR in a clean application that also has a custom definition of # config/initializers/spree.rb
Spree::Image.attachment_definitions[:attachment][:styles] = {
mini: '48x48>',
small: '100x100>',
product: '240x240>',
large: '600x600>',
mobile: '400x500>',
} Everything works as expected but we need to fix what @spaghetticode spotted, thanks @elia ! |
d387a72
to
7205f46
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you @elia & @kennyadsl 🤝
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool! Nice work @elia 👍
We keep Paperclip as the default strategy for new apps.
7205f46
to
55abebe
Compare
Description
This PR has been extracted from #2974 as suggested by @kennyadsl
Paperclip has been officially deprecated and is no more maintained, but the supposed replacement with ActiveStorage is not possible to due to lack of proper support for public long-term urls.
This PR allows Image and Taxon to switch their attachment implementation, extracting Paperclip to a concern, and opening the door for alternative implementations (e.g. Carrierwave, Shrine, AttachmentFu, et cetera).
Checklist: