Define two scopes on List that return the finished and unfinished items then use
List.unfinished.count
Colin
> Best Regards
> Linus
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/aFmyk69tHdUJ.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
> So I can use the List.unfinished.... But how do I add it as attributes to
the json output?
>
>
>
Seems you are confusing search patterns with object output. Your JSON output
should already include a "status" field.
发自我的 iPhone
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/gy0mFW1iV44J.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What has that got to do with the subject of this thread, which is Add
virtual attribute? It is best to start a new thread for a new
subject, with a subject line that matches the question.
Colin