Sha256: fc04de20373883886b81adc3f3a65fe4498743b149de654de9644f3af9ea621f

Contents?: true

Size: 574 Bytes

Versions: 22

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

module Katalyst
  module Tables
    module Collection
      module Type
        class Search < Value
          # @overwrite Value.initialize() to require scope
          # rubocop:disable Lint/UselessMethodDefinition
          def initialize(scope:, **)
            super
          end
          # rubocop:enable Lint/UselessMethodDefinition

          def type
            :search
          end

          def filter_condition(model, _, value)
            model.public_send(scope, value)
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katalyst-tables-3.3.1 app/models/katalyst/tables/collection/type/search.rb
katalyst-tables-3.3.0 app/models/katalyst/tables/collection/type/search.rb