I have two classes both having an attachment to be delayed-processed. One of them have :processing_image_url option specified and another don't, looks like:
class Person < ActiveRecord::Base
has_attached_file :avatar, PAPERCLIP_STORAGE_OPTS
process_in_background :avatar, processing_image_url: "in_processing.png"
end
class Organization < ActiveRecord::Base
has_attached_file :picture, PAPERCLIP_STORAGE_OPTS
process_in_background :picture
end
In this setting, Person#processing_image_url may return nil. I have tried in rails console and got the result below:
$ rails c
> person = Person.find 1
> organization = Organization.find 1
> organization.picture.processing_image_url #=> nil
> person.avatar.processing_image_url #=> nil; but I expects this to be "in_processing.png".
This behavior seems to depends on the load order of the classes; when I loaded (instanciated?) Organization first, the instance of Person keeps the option correct.
I suspect this is caused by overwriting paperclip_definitions in DelayedPaperclip::ClassMethodss#process_in_background.
I have two classes both having an attachment to be delayed-processed. One of them have :processing_image_url option specified and another don't, looks like:
In this setting, Person#processing_image_url may return nil. I have tried in rails console and got the result below:
This behavior seems to depends on the load order of the classes; when I loaded (instanciated?) Organization first, the instance of Person keeps the option correct.
I suspect this is caused by overwriting paperclip_definitions in DelayedPaperclip::ClassMethodss#process_in_background.