Sha256: b6c237e913a0d922cf4672fb4ac424e21079513450c7395ff1366dd1a09c9532
Contents?: true
Size: 616 Bytes
Versions: 10
Compression:
Stored size: 616 Bytes
Contents
# frozen_string_literal: true module Mensa class Filter include ConfigReaders attr_reader :column, :value, :config, :table config_reader :scope def initialize(value, column:, config:, table:) @value = value @column = column @config = config @table = table end def collection return unless config&.key?(:collection) if config[:collection].is_a? Proc table.original_view_context.instance_exec(&config[:collection]) else config[:collection] end end def to_s "#{column.human_name}: #{value}" end end end
Version data entries
10 entries across 10 versions & 1 rubygems