Class: Order

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/order.rb

Instance Method Summary collapse

Instance Method Details

#acknowledgeObject

METHODS



7
8
9
# File 'app/models/order.rb', line 7

def acknowledge
  Orders::AcknowledgeWorker.perform_async id
end

#acknowledged!Object



11
12
13
# File 'app/models/order.rb', line 11

def acknowledged!
  update_attribute(:acknowledged, true)
end

#completeObject



15
16
17
18
19
20
# File 'app/models/order.rb', line 15

def complete
  return if complete?

  update_attribute(:complete, true)
  Orders::CompleteWorker.perform_async id
end

#performObject



22
23
24
# File 'app/models/order.rb', line 22

def perform
  "orders/#{keyword}_worker".camelize.constantize.perform_async(id)
end