Sha256: 4a777a9a16b3ee09a086d6d96cbdcce42a00e84ebc051126c80bb6f37639b952

Contents?: true

Size: 404 Bytes

Versions: 2

Compression:

Stored size: 404 Bytes

Contents

module Findable
  class FindableError < StandardError; end

  class RecordNotFound < FindableError
    def initialize(model, params)
      params.symbolize_keys! if params.is_a?(Hash)
      super("Couldn't find #{model.model_name.name} with #{params.inspect}")
    end
  end

  class ModelNotFound < FindableError
    def initialize(model_name)
      super("#{model_name} not found.")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
findable-0.1.1 lib/findable/errors.rb
findable-0.1.0 lib/findable/errors.rb