search for: people_count

Displaying 3 results from an estimated 3 matches for "people_count".

2006 Mar 30
3
Model.find(:all) where Model.association has more then 0 items?
Hi everyone, I have a Department model that has_many people. How do I go about finding all departments with more than 0 people? Department.find(:all, :conditions => Department.people.size > 0) That, of course, doesn''t work, but it was as close as I could come. Thanks! Sean
2006 Jul 20
3
Does Find also tell you a count of the array size?
When I use @persons = Find(:all) (for example) and I get back an array of persons, is there an easy way to tell how many rows the find returned? I have been using Persons.count(:all) but you would think Find knows how many it returned -- is the count/array size stored somewhere in the ret array? -- Posted via http://www.ruby-forum.com/.
2006 Apr 18
1
what happened to my increment_counter method?
...<Company: 0x259e3b0> from /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.2/ lib/active_record/base.rb:1792:in `method_missing'' from (irb):8 if i type: Company.inc and then hit tab, .increment_counter shows up. i''m confused. Rails 1.1.2 i do have a people_count column in my company table zuh?