Sha256: 3ad93a8b2806eec955f374be32669c2bcd62295556d6536268ec6edf209b5ae5

Contents?: true

Size: 456 Bytes

Versions: 1

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module ScopeHound
  # Delegates all the filtering methods to the filter_proxy
  module FilterableModel
    extend ActiveSupport::Concern

    def filter_proxy
      raise "
            Model #{name} including FilterableModel concern requires filter_proxy method to be defined.
            Method should return filter proxy class associated to model.
          "
    end

    delegate :filter_by, to: :filter_proxy
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scope_hound-0.1.0 app/models/concerns/scope_hound/filterable_model.rb