class ReportsKits::Reports::FilterTypes::Records

Constants

DEFAULT_CRITERIA

Public Instance Methods

apply_conditions(records) click to toggle source
# File lib/reports_kits/reports/filter_types/records.rb, line 9
def apply_conditions(records)
  case criteria[:operator]
  when 'include'
    records.where(column => value)
  when 'does_not_include'
    records.where.not(column => value)
  else
    raise ArgumentError.new("Unsupported operator: '#{criteria[:operator]}'")
  end
end
valid?() click to toggle source
# File lib/reports_kits/reports/filter_types/records.rb, line 20
def valid?
  value.present?
end