Sha256: f3a5f6baabe85ba08a674d8540f4f7f902ebc02d0a65601ff0fead52196fad87
Contents?: true
Size: 750 Bytes
Versions: 17
Compression:
Stored size: 750 Bytes
Contents
# frozen_string_literal: true require "active_admin/filters/active_filter" module ActiveAdmin module Filters class Active attr_accessor :filters, :resource # Instantiate a `Active` object containing collection of current active filters # @param resource [ActiveAdmin::Resource] current resource # @param search [Ransack::Search] search object # # @see ActiveAdmin::ResourceController::DataAcces#apply_filtering def initialize(resource, search) @resource = resource @filters = build_filters(search.conditions) end private def build_filters(conditions) conditions.map { |condition| ActiveFilter.new(resource, condition.dup) } end end end end
Version data entries
17 entries across 17 versions & 1 rubygems