Module: PaperclipLambda::ClassMethods
- Defined in:
- lib/paperclip_lambda.rb
Instance Method Summary collapse
- #paperclip_definitions ⇒ Object
- #process_delete_in_lambda(attachment_name, options = {}) ⇒ Object
- #process_in_lambda(name, function_name, options = { }) ⇒ Object
Instance Method Details
#paperclip_definitions ⇒ Object
31 32 33 34 35 |
# File 'lib/paperclip_lambda.rb', line 31 def paperclip_definitions @paperclip_definitions ||= if respond_to? :attachment_definitions end end |
#process_delete_in_lambda(attachment_name, options = {}) ⇒ Object
27 28 29 |
# File 'lib/paperclip_lambda.rb', line 27 def process_delete_in_lambda(, = {}) PaperclipLambda::Client.new(paperclip_definitions[:"#{}"][:lambda][:function_name], ) end |
#process_in_lambda(name, function_name, options = { }) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/paperclip_lambda.rb', line 15 def process_in_lambda(name, function_name, = { }) paperclip_definitions[name][:lambda] = { } paperclip_definitions[name][:lambda][:function_name] = function_name paperclip_definitions[name][:lambda][:attributes] = [:attributes] || [] if respond_to?(:after_commit) after_commit :enqueue_lambda_processing else after_save :enqueue_lambda_processing end end |