46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/delayed_paperclip.rb', line 46
def process_in_background(name, options = {})
paperclip_definitions[name][:delayed] = {}
only_process_default = paperclip_definitions[name][:only_process]
only_process_default ||= []
{
:priority => 0,
:only_process => only_process_default,
:url_with_processing => DelayedPaperclip.options[:url_with_processing],
:processing_image_url => DelayedPaperclip.options[:processing_image_url],
:queue => DelayedPaperclip.options[:queue]
}.each do |option, default|
paperclip_definitions[name][:delayed][option] = options.key?(option) ? options[option] : default
end
if respond_to?(:after_commit)
after_commit :enqueue_delayed_processing
else
after_save :enqueue_delayed_processing
end
end
|