Exception: Sequel::NoMatchingRow
- Defined in:
- lib/sequel/exceptions.rb
Overview
Error raised when the user requests a record via the first! or similar method, and the dataset does not yield any rows.
Instance Attribute Summary collapse
-
#dataset ⇒ Object
The dataset that raised this NoMatchingRow exception.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(msg = nil) ⇒ NoMatchingRow
constructor
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.
Methods inherited from Error
Constructor Details
#initialize(msg = nil) ⇒ NoMatchingRow
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.
104 105 106 107 108 109 110 |
# File 'lib/sequel/exceptions.rb', line 104 def initialize(msg=nil) if msg.is_a?(Sequel::Dataset) @dataset = msg msg = nil end super end |
Instance Attribute Details
#dataset ⇒ Object
The dataset that raised this NoMatchingRow exception.
100 101 102 |
# File 'lib/sequel/exceptions.rb', line 100 def dataset @dataset end |