class Sequel::NoMatchingRow

  1. lib/sequel/exceptions.rb
Superclass: Error

Error raised when the user requests a record via the first! or similar method, and the dataset does not yield any rows.

Methods

Public Class

  1. new

Public Instance

  1. dataset

Attributes

dataset [RW]

The dataset that raised this NoMatchingRow exception.

Public Class methods

new (msg=nil)

If the first argument is a Sequel::Dataset, set the dataset related to the exception to that argument, instead of assuming it is the exception message.

[show source]
# File lib/sequel/exceptions.rb, line 94
def initialize(msg=nil)
  if msg.is_a?(Sequel::Dataset)
    @dataset = msg
    msg = nil
  end
  super
end