49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/delayed_paperclip.rb', line 49
def process_in_background(name, options = {})
paperclip_definitions[name][:delayed] = {}
{
:priority => 0,
:only_process => paperclip_definitions[name][:only_process],
:url_with_processing => DelayedPaperclip.options[:url_with_processing],
:processing_image_url => options[:processing_image_url]
}.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
|