Sha256: c16c5d21f5e9050520db00339b8e8176dd4dac602edad71d546056e3c580712a
Contents?: true
Size: 516 Bytes
Versions: 8
Compression:
Stored size: 516 Bytes
Contents
module Outpost module Controller module Filtering private def filter_records if params[:filter].is_a? Hash params[:filter].each do |attribute, value| next if value.blank? scope = "filtered_by_#{attribute}" if @records.klass.respond_to? scope @records = @records.send(scope, value) else @records = @records.where(attribute => value) end end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems