Class: ScansController

Inherits:
ApplicationController show all
Defined in:
app/controllers/scans_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#index

Instance Method Details

#create ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/scans_controller.rb', line 2

def create
  authorize :scan
  # Load filters
  @filter = Search::FilterService.new(params)
  # Prune orphaned problems
  Upgrade::PruneOrphanedProblems.perform_later
  if params[:type] === "check"
    # Get filter list
    Scan::CheckAllJob.perform_later(@filter.to_params, current_user)
  else
    Library.find_each do |library|
      library.detect_filesystem_changes_later
    end
  end
  redirect_back_or_to models_path(@filter.to_params), notice: t(".success")
end