Class: AuditsController

Inherits:
ApplicationController show all
Includes:
Foreman::Controller::AutoCompleteSearch
Defined in:
app/controllers/audits_controller.rb

Instance Method Summary collapse

Methods included from Foreman::Controller::AutoCompleteSearch

#auto_complete_search, #invalid_search_query

Methods inherited from ApplicationController

#api_request?, #welcome

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#indexObject


8
9
10
11
12
13
# File 'app/controllers/audits_controller.rb', line 8

def index
  Audit.unscoped { @audits = Audit.search_for(params[:search], :order => params[:order]).paginate :page => params[:page] }
rescue => e
  error e.to_s
  @audits = Audit.search_for('', :order => params[:order]).paginate :page => params[:page]
end

#showObject


15
16
17
18
# File 'app/controllers/audits_controller.rb', line 15

def show
  @audit = Audit.find(params[:id])
  @history = Audit.descending.where(:auditable_id => @audit.auditable_id, :auditable_type => @audit.auditable_type)
end