diagrams_controller.rb 423 B

12345678910111213
  1. class DiagramsController < ApplicationController
  2. def show
  3. if params[:scenario_id].present?
  4. @scenario = current_user.scenarios.find(params[:scenario_id])
  5. agents = @scenario.agents
  6. else
  7. agents = current_user.agents
  8. end
  9. @disabled_agents = agents.inactive
  10. agents = agents.active if params[:exclude_disabled].present?
  11. @agents = agents.includes(:receivers, :control_targets)
  12. end
  13. end