Class: BulkAction
Overview
Instance Method Summary
collapse
Instance Method Details
#check_run_state ⇒ Object
43
44
45
46
47
48
|
# File 'app/models/bulk_action.rb', line 43
def check_run_state
nil if state_machine.current_state == "complete"
end
|
#collect_documents ⇒ Object
55
56
57
58
59
60
61
62
63
|
# File 'app/models/bulk_action.rb', line 55
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
50
51
52
53
|
# File 'app/models/bulk_action.rb', line 50
def revert!
BulkActionRevertJob.perform_later(self)
end
|
#run! ⇒ Object
32
33
34
35
36
37
38
39
40
41
|
# File 'app/models/bulk_action.rb', line 32
def run!
BulkActionRunJob.perform_later(self)
end
|
#state_machine ⇒ Object
28
29
30
|
# File 'app/models/bulk_action.rb', line 28
def state_machine
@state_machine ||= BulkActionStateMachine.new(self, transition_class: BulkActionTransition)
end
|