Sha256: 50b5c61cb9b2dd12b614056f518a92ae53f6b79184009a9848a68c8611c869dd

Contents?: true

Size: 373 Bytes

Versions: 18

Compression:

Stored size: 373 Bytes

Contents

module Symphonia
  module ModelFilters
    class StringFilter < Base

      def apply(scope)
        super
        t = scope.arel_table
        scope.where(t[name].lower.send(operator, value&.downcase))
      end

      def form_field(context)
        context.text_field_tag(form_field_name, @query.active_filters[name], class: 'form-control')
      end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
symphonia-6.0.6 lib/symphonia/model_filters/string_filter.rb
symphonia-6.0.5 lib/symphonia/model_filters/string_filter.rb
symphonia-6.0.4 lib/symphonia/model_filters/string_filter.rb
symphonia-6.0.2 lib/symphonia/model_filters/string_filter.rb
symphonia-6.0.1 lib/symphonia/model_filters/string_filter.rb
symphonia-6.0.0 lib/symphonia/model_filters/string_filter.rb
symphonia-5.0.6 lib/symphonia/model_filters/string_filter.rb
symphonia-5.0.5 lib/symphonia/model_filters/string_filter.rb
symphonia-5.0.4 lib/symphonia/model_filters/string_filter.rb
symphonia-5.0.3 lib/symphonia/model_filters/string_filter.rb
symphonia-5.0.0 lib/symphonia/model_filters/string_filter.rb
symphonia-4.2.0 lib/symphonia/model_filters/string_filter.rb
symphonia-4.1.3 lib/symphonia/model_filters/string_filter.rb
symphonia-4.1.2 lib/symphonia/model_filters/string_filter.rb
symphonia-4.1.1 lib/symphonia/model_filters/string_filter.rb
symphonia-4.1.0 lib/symphonia/model_filters/string_filter.rb
symphonia-4.0.1 lib/symphonia/model_filters/string_filter.rb
symphonia-4.0.0 lib/symphonia/model_filters/string_filter.rb