Is there a way of counting the number of boolean values in your
db ???
Try "=" instead of "==".
Opinion.count(:conditions => "agree = true")
Something like that worked for me with one of my models in
script/console.
Regards,
Craig
Opinion.count(:conditions => "agree = true") will work fine.
I has thought Opinion.sum(:agree) will work fine too,but it didn't,this
generate the sql:
select sum('opinions'.agree) as sum_agree from 'opinions',
and returns 0 forever,I copy this sql and execute it by hand,it will
work fine just like the Opinion.count(:conditions => "agree = true").So
it maybe some strange?