[Rails] Re: Converting SQL query to Rails query for a non model attribute
On Nov 25, 3:05 pm, "Mohnish J." <li...@ruby-forum.com> wrote:
> Frederick Cheung wrote in post #1033538:
>
> > On Nov 24, 12:28pm, "Mohnish J." <li...@ruby-forum.com> wrote:
>
> >> I got the same sql query as above. But somehow since the **count(area)**
> >> is not a direct attribute of the Users model, I'm unable to print it
> >> using a Rails query.
>
> > What do you mean by print? If you means that it doesn't show up in the
> > output from inspect then that's normal - inspect only ever shows data
> > from the actual columns on the table. You can still call total (in
> > this case) to get that value.
>
> Hi Fred...
>
> By print, I basically am trying to get the output on the Rails console
> for a "non model attribute" in particular.. which I'm unable to do ,
> yet..
like I said, just call the method. Just because it doesn't show up in
the output from inspect doesn't mean it's not there.
Fred
>
> --
> Posted viahttp://www.ruby-forum.com/.
--
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