Method: ActiveRecord::Result#each
- Defined in:
- activerecord/lib/active_record/result.rb
#each(&block) ⇒ Object
Calls the given block once for each element in row collection, passing row as parameter.
Returns an Enumerator if no block is given.
73 74 75 76 77 78 79 |
# File 'activerecord/lib/active_record/result.rb', line 73 def each(&block) if block_given? hash_rows.each(&block) else hash_rows.to_enum { @rows.size } end end |