Tuesday, March 6, 2012

Re: [Rails] getting find_by_sql to return the numeric value rather than an object that contains the value as an attribute

On 6 March 2012 15:08, John Merlino <stoicism1@aol.com> wrote:
>
> 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.

value  = Report.get_sum_for_range(unit.id,report1,report2).sum

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate