Sha256: 3eb86d632f4259085ce404e800e1450311ffc3337cf195ab34dc5454564fac4e

Contents?: true

Size: 943 Bytes

Versions: 4

Compression:

Stored size: 943 Bytes

Contents

class LoggedExceptionsController < ApplicationController
  def index
    @exceptions = LoggedException.all(:select => '*, COUNT(*) as count', :group => 'group_id', :order => 'created_at DESC')
  end

  def details
    @exceptions = LoggedException.paginate(:all, :conditions => { :group_id => params[:id] }, :order => 'created_at DESC', :page => params[:page], :per_page => 1)
    @exception = @exceptions.first
  end

  def remove_all
    LoggedException.delete_all
    redirect_to :action => :index
  end

  def remove_group
    LoggedException.delete_all(:group_id => params[:id])
    redirect_to :action => :index
  end

  def remove_individual
    exception = LoggedException.find_by_id(params[:id])
    exception.destroy

    if LoggedException.count(:conditions => { :group_id => exception.group_id }).zero?
      redirect_to :action => :index
    else
      redirect_to :action => :details, :id => exception.group_id
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tartarus-2.0.4 spec/rails_app/app/controllers/logged_exceptions_controller.rb
tartarus-2.0.3 spec/rails_app/app/controllers/logged_exceptions_controller.rb
tartarus-2.0.1 spec/rails_app/app/controllers/logged_exceptions_controller.rb
tartarus-2.0.0 spec/rails_app/app/controllers/logged_exceptions_controller.rb