Module: WithStatus
- Extended by:
- ActiveSupport::Concern
- Included in:
- Assignment
- Defined in:
- app/models/concerns/with_status.rb
Instance Method Summary collapse
- #aborted? ⇒ Boolean
- #errored!(message) ⇒ Object
- #passed! ⇒ Object
- #passed? ⇒ Boolean
- #run_update! ⇒ Object
- #running! ⇒ Object
Instance Method Details
#aborted? ⇒ Boolean
13 14 15 |
# File 'app/models/concerns/with_status.rb', line 13 def aborted? status == :aborted end |
#errored!(message) ⇒ Object
39 40 41 |
# File 'app/models/concerns/with_status.rb', line 39 def errored!() update! result: , status: :errored end |
#passed! ⇒ Object
27 28 29 |
# File 'app/models/concerns/with_status.rb', line 27 def passed! update! status: :passed end |
#passed? ⇒ Boolean
9 10 11 |
# File 'app/models/concerns/with_status.rb', line 9 def passed? status.passed? end |
#run_update! ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/models/concerns/with_status.rb', line 17 def run_update! running! begin update! yield rescue => e errored! e. raise e end end |
#running! ⇒ Object
31 32 33 34 35 36 37 |
# File 'app/models/concerns/with_status.rb', line 31 def running! update! status: :running, result: nil, test_results: nil, expectation_results: [], manual_evaluation_comment: nil end |