Class: BulkAction
Overview
Instance Method Summary
collapse
Instance Method Details
#check_run_state ⇒ Object
42
43
44
45
46
47
|
# File 'app/models/bulk_action.rb', line 42
def check_run_state
nil if state_machine.current_state == "complete"
end
|
#collect_documents ⇒ Object
54
55
56
57
58
59
60
61
62
|
# File 'app/models/bulk_action.rb', line 54
def collect_documents
cgi = CGI.unescape(scope)
uri = URI.parse(cgi)
if uri.path.include?("fetch")
fetch_documents(uri)
else
api_documents(uri)
end
end
|
#revert! ⇒ Object
49
50
51
52
|
# File 'app/models/bulk_action.rb', line 49
def revert!
BulkActionRevertJob.perform_later(self)
end
|
#run! ⇒ Object
31
32
33
34
35
36
37
38
39
40
|
# File 'app/models/bulk_action.rb', line 31
def run!
BulkActionRunJob.perform_later(self)
end
|
#state_machine ⇒ Object
27
28
29
|
# File 'app/models/bulk_action.rb', line 27
def state_machine
@state_machine ||= BulkActionStateMachine.new(self, transition_class: BulkActionTransition)
end
|