Method: Sequel::Dataset#all
- Defined in:
- lib/sequel/dataset/actions.rb
#all(&block) ⇒ Object
Returns an array with all records in the dataset. If a block is given, the array is iterated over after all items have been loaded.
DB[:table].all # SELECT * FROM table
# => [{:id=>1, ...}, {:id=>2, ...}, ...]
# Iterate over all rows in the table
DB[:table].all{|row| p row}
50 51 52 |
# File 'lib/sequel/dataset/actions.rb', line 50 def all(&block) _all(block){|a| each{|r| a << r}} end |