Displaying 1 result from an estimated 1 matches for "m000726".
Did you mean:
m000126
2006 Feb 24
1
Returning a "select count()" in ActiveRecord
I am trying to find the count of rows on a table. If I do a
result= Table.find_by_sql ("select count(distinct id) ......
It returns an array of Table with Hashes of "select count(distinct id)"
making accessing it a pain
result[0][''select count(distinct id)'']
It seems easier to return all the rows and do a .length on the result
Array.