Comments (8)
Hi,
What case do you mean exactly?
- The callback is not called during the "front end" process, but later during the DJ process.
- The callback is never called, not even during the DJ process.
from delayed_paperclip.
From my experience the callback are never called.
The correct behavior would be that it they are called during the DJ process.
from delayed_paperclip.
Alright, here I come again.
Callbacks work, you just need to be sure that the
after_post_process in placed before the process_in_background definition.
However, and this is a big issue. The after_post_process callback is still called before the after save, so the url of the picture is not accessible. So if I want to send a mail with the photo or post a link to facebook with the embeded picture, this is not doable.
How would you go around that issue ? What other callback can I use ?
from delayed_paperclip.
The problem lays with the method url_with_processed. This method will use the default_url options as long as the processing hasn't happend.
When joining this project this functionality was present and I kept it during the rewrite.
However, at my job where we are using this feature, we disagreed with the reasoning behind this method. We believe that when the file exists, its URL should also exist. It's the controller's job to handle the "not jet processed" case.
We removed the method and are using the original url method provided by paperclip.
In your case there are a few things you could do.
- In the mail use the url_without_processed method
- remove the url_with_processed method and restore the original url method
If you'd like to see this url behaviour change, please let me know. Or should we make it a configurable option?
from delayed_paperclip.
Wow I didn't know about the url_without_processed method, that is great, I'll try that right away.
from delayed_paperclip.
Hi,
I was wondering if this solved your issue. If so, the latest git/HEAD version now has ":url_with_processing => false" which will not modify the URL while processing.
from delayed_paperclip.
I'm closing this as there has been no response in almost 2 months.
from delayed_paperclip.
@rnaud I haven't had any success with the solution you mentioned before. My after_attachment_post_process hooks are still not calling. I've also tried the fix mentioned by @Bertg by changing the options inside of delayed_paperclip.
Could you elaborate on your solution to get callbacks working?
EDIT
my current apprach has been to create a config/initializers/delayed_paperclip.rb
file with the following contents:
DelayedPaperclip.options[:url_without_processed] = false
But it only seems to be executing the after_attachment_post_process callback, while the rails family of callbacks appears to be running outside of Delayed Job workers. I suspect this is expected functionality. My next step is to try and process the entire model as a Delayed Job.
from delayed_paperclip.
Related Issues (20)
- No more url_without_processed method HOT 1
- PGError in process_job (delayed_paperclip.rb) HOT 1
- different value for paperclip's queued_for_write[:original].path
- [Feature] girl_friday as backend
- Process completion notification HOT 2
- Cannot find file at Amazon S3. HOT 3
- Got job.. and job done, instantly.. HOT 1
- Delayed Paperclip does not generate all styles in latest version of Paperclip (v 3.0.4) HOT 4
- Looks like project is dead? HOT 1
- Custom styles of paperclip are not rendered in process_in_background. HOT 12
- image_processing set to false before s3 write finishes HOT 6
- How to setup to display processing message during image processing HOT 2
- Delayed processing of URI's HOT 2
- Resque enqueue HOT 1
- Regenerate a cache after processing of an image HOT 1
- Help testing against edge resque HOT 4
- undefined method `[]' for nil:NilClass HOT 2
- Temp files not deleted
- create is not work with delayed_job Paperclip, shows undefined method '[]' Nil::Class
- post_process hooks don't run when attachments are processed in background HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delayed_paperclip.