title: how to get unvoted post count in Ruby on Rails
body: <p>I am using <a href="https://github.com/bouchard/thumbs_up" rel="nofollow">Thumbs_up</a> gem for creating vote function. I have 3 tables - Post, User and Vote where Post is <strong>acts_as_voteable</strong> and User is <strong>acts_as_voter</strong>.</p>
  
  <p>Model Post.rb</p>
  
  <pre><code>class Post &lt; ActiveRecord::Base
    attr_accessible :title, :content, :user_type
    acts_as_voteable
    validates_presence_of :title,:content
    default_scope order: 'posts.created_at DESC'
  end
  </code></pre>
  
  <p>Model Vote.rb</p>
  
  <pre><code>class Vote &lt; ActiveRecord::Base
      scope :for_voter, lambda { |*args| where(["voter_id = ? AND voter_type = ?", args.first.id, args.first.class.base_class.name]) }
      scope :for_voteable, lambda { |*args| where(["voteable_id = ? AND voteable_type = ?", args.first.id, args.first.class.base_class.name]) }
      scope :recent, lambda { |*args| where(["created_at &gt; ?", (args.first || 2.weeks.ago)]) }
      scope :descending, order("created_at DESC")
      belongs_to :voteable, :polymorphic =&gt; true
      belongs_to :voter, :polymorphic =&gt; true
      attr_accessible :vote, :voter, :voteable
  
  end
  </code></pre>
  
  <p>Model User.rb</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
     attr_accessible :name, :email, :password, :password_confirmation
     has_secure_password
     acts_as_voter
     has_many :posts, dependent: :destroy
  end
  </code></pre>
  
  <p>Now I want to count posts number which are <strong><em>NOT VOTED</em></strong>. I am trying to do like this..</p>
  
  <pre><code>&lt;%= Post.joins(:votes).where("dont_know_how_to_write_condition").count %&gt;
  </code></pre>
  
  <p>Any help?? Thanks in advance</p>