Class: Rscratch::ExceptionsController

Inherits:
ApplicationController show all
Includes:
SmartListing::Helper::ControllerExtensions
Defined in:
app/controllers/rscratch/exceptions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate

Instance Method Details

#indexObject



9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/rscratch/exceptions_controller.rb', line 9

def index
  @exceptions = Rscratch::Exception.order("updated_at desc")
  smart_listing_create :exceptions, @exceptions.by_status('new'), partial: "rscratch/exceptions/exception_smartlist"
  smart_listing_create :resolved_exceptions, @exceptions.by_status('resolved'), partial: "rscratch/exceptions/exception_smartlist"
  respond_to do |format|
    format.html # index.html.erb
    format.js
    format.json { render json: @exceptions }
  end      
end

#logObject



26
27
28
# File 'app/controllers/rscratch/exceptions_controller.rb', line 26

def log

end

#resolveObject



36
37
38
39
40
# File 'app/controllers/rscratch/exceptions_controller.rb', line 36

def resolve
  @excp.resolve!
  @excp.reload
  rescue Exception => @error          
end

#showObject



20
21
22
23
24
# File 'app/controllers/rscratch/exceptions_controller.rb', line 20

def show
  @log = @excp.exception_logs.order("created_at desc").page(params[:page]).per(1)
  @historical_data = @excp.exception_logs.select("count(id) as exception_count, date(created_at) as date").group("date(created_at)").order("date(created_at)").last(30) if params[:page] == "1"
  rescue Exception => @error          
end

#toggle_ignoreObject



30
31
32
33
34
# File 'app/controllers/rscratch/exceptions_controller.rb', line 30

def toggle_ignore
  @excp.toggle_ignore!
  @excp.reload
  rescue Exception => @error          
end