diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-10-13 12:01:41 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-10-13 12:01:41 -0700 |
commit | f0c2c6469f142e826ac2c60673bba2d18d7df6e6 (patch) | |
tree | b04bb2641572b322ae9a2e7c4052f2af2ffd5926 /activerecord/lib/active_record/result.rb | |
parent | 3c3a344aecba871ab9335dee7eee077dea1bce20 (diff) | |
download | rails-f0c2c6469f142e826ac2c60673bba2d18d7df6e6.tar.gz rails-f0c2c6469f142e826ac2c60673bba2d18d7df6e6.tar.bz2 rails-f0c2c6469f142e826ac2c60673bba2d18d7df6e6.zip |
add length to ActiveRecord::Result
Diffstat (limited to 'activerecord/lib/active_record/result.rb')
-rw-r--r-- | activerecord/lib/active_record/result.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/result.rb b/activerecord/lib/active_record/result.rb index 8405fdaeb9..3a3e65ef32 100644 --- a/activerecord/lib/active_record/result.rb +++ b/activerecord/lib/active_record/result.rb @@ -42,6 +42,10 @@ module ActiveRecord @column_types = column_types end + def length + @rows.length + end + def each if block_given? hash_rows.each { |row| yield row } |