So I have a custom query that I embedded into a class method
find_by_sql(["SELECT SUM(distance * 0.000621371192) as sum FROM
reports WHERE unit_id=? AND id >= ? AND id <= ?", unit_id, report1,
value = Report.get_sum_for_range(unit.id,report1,report2)
The problem is value will be a report object that contains an
attribute called sum with the value, but all I want is just the value
itself returned into value.
thanks for response
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to firstname.lastname@example.org.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.