Sha256: f6444d98b5b21f62eaf8fb085aee8c4910bf040031c3abc48012a55cb28de5f2

Contents?: true

Size: 456 Bytes

Versions: 4

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

module CheeseCloth
  class MissingScopeError < StandardError
    def initialize(klass)
      @klass = klass
    end

    def message
      <<-MSG.strip_heredoc
        Was unable to determine the base scope. Perhaps you forgot to call `scope`?"

        Try something like:

        class #{@klass.name || 'FooFilterer'}
          include CheeseCloth

          scope -> { Model.all }
        end
      MSG
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cheesecloth-0.1.3 lib/cheesecloth/errors.rb
cheesecloth-0.1.2 lib/cheesecloth/errors.rb
cheesecloth-0.1.1 lib/cheesecloth/errors.rb
cheesecloth-0.1.0 lib/cheesecloth/errors.rb