instance method
hash_rows
Ruby on Rails 3.2.22.5
Since v3.1.12 PrivateSignature
hash_rows()
No documentation comment.
Source
# File activerecord/lib/active_record/result.rb, line 28
def hash_rows
@hash_rows ||=
begin
# We freeze the strings to prevent them getting duped when
# used as keys in ActiveRecord::Model's @attributes hash
columns = @columns.map { |c| c.dup.freeze }
@rows.map { |row|
Hash[columns.zip(row)]
}
end
end
Defined in activerecord/lib/active_record/result.rb line 28
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Result