Class: ForemanPatch::Api::V2::InvocationsController
- Inherits:
-
BaseController
- Object
- Api::V2::BaseController
- BaseController
- ForemanPatch::Api::V2::InvocationsController
- Defined in:
- app/controllers/foreman_patch/api/v2/invocations_controller.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #index ⇒ Object
- #resource_class ⇒ Object
- #resource_scope(options = {}) ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#destroy ⇒ Object
40 41 42 |
# File 'app/controllers/foreman_patch/api/v2/invocations_controller.rb', line 40 def destroy process_response @invocation.destroy end |
#index ⇒ Object
19 20 21 |
# File 'app/controllers/foreman_patch/api/v2/invocations_controller.rb', line 19 def index @invocations = resource_scope_for_index end |
#resource_class ⇒ Object
44 45 46 |
# File 'app/controllers/foreman_patch/api/v2/invocations_controller.rb', line 44 def resource_class ForemanPatch::Invocation end |
#resource_scope(options = {}) ⇒ Object
48 49 50 51 52 53 54 |
# File 'app/controllers/foreman_patch/api/v2/invocations_controller.rb', line 48 def resource_scope( = {}) if action_name == 'index' @round.invocations.includes(:host).where(host: ::Host.(:view_hosts, ::Host)) else super() end end |
#show ⇒ Object
25 26 27 |
# File 'app/controllers/foreman_patch/api/v2/invocations_controller.rb', line 25 def show @invocation = ForemanPatch::Invocation.find(params[:id]) end |
#update ⇒ Object
34 35 36 |
# File 'app/controllers/foreman_patch/api/v2/invocations_controller.rb', line 34 def update process_response @invocation.update(invocation_params) end |