Jeff Schwab wrote:
> Jay Covington wrote:
>> :item1 fields, but I need to retrieve the count for "Apple" from the
>> columns :item2, :item3, and :item4 as well as :item1. Any ideas? Thanks!
> 
> item_ids = 1..4
> apple_query = item_ids.map {|id| "item#{id} = 'Apple'" }.join(" OR ")
> apple_count = ItemList.count(:all, :conditions => apple_query)

This method works! Thanks for replying!
-- 
Posted via http://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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to