Class: Platform::LoggedExceptionFilter

Inherits:
BaseFilter show all
Defined in:
app/models/platform/logged_exception_filter.rb

Overview

– Copyright © 2011 Michael Berkovich

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++

Instance Method Summary collapse

Methods inherited from BaseFilter

#default_order_type

Instance Method Details

#date_conditionObject



34
35
36
37
38
# File 'app/models/platform/logged_exception_filter.rb', line 34

def date_condition
  date_criteria = definition[:created_at]
  return date_criteria.container.sql_condition if date_criteria and (date_criteria.validate == nil)
  nil
end

#default_criteria_keyObject



30
31
32
# File 'app/models/platform/logged_exception_filter.rb', line 30

def default_criteria_key
  :exception_class
end

#default_filter_conditions(key) ⇒ Object



46
47
48
49
50
51
52
# File 'app/models/platform/logged_exception_filter.rb', line 46

def default_filter_conditions(key)
  if (key=="created_today")
    @order      ='created_at'
    @order_type ='desc'
    return [:created_at, :is_on, Date.today]
  end
end

#default_filter_if_emptyObject



54
55
56
# File 'app/models/platform/logged_exception_filter.rb', line 54

def default_filter_if_empty
  "created_today"
end

#default_filtersObject



40
41
42
43
44
# File 'app/models/platform/logged_exception_filter.rb', line 40

def default_filters
  [
    ["Exceptions Logged Today", "created_today"],
  ]
end

#default_orderObject



26
27
28
# File 'app/models/platform/logged_exception_filter.rb', line 26

def default_order
  'created_at'
end