title: Rails : SQLite3::SQLException with has_and_belongs_to_many Association
body: <p>I get a new problem with my application.</p>
  
  <p>I try to make a relationships many-to-many like this : <a href="http://guides.rubyonrails.org/association_basics.html#the-has_and_belongs_to_many-association" rel="nofollow">http://guides.rubyonrails.org/association_basics.html#the-has_and_belongs_to_many-association</a>
  Here I use has_and_belongs_to_many to "connect" two tables : User &amp; Pins </p>
  
  <p>But I get this error when I try to count the number of pins of the user.</p>
  
  <pre><code>Showing /app/views/shared/_users_pins.html.erb where line #4 raised:
  
  SQLite3::SQLException: no such column: pins_users.user_id: SELECT COUNT(*) FROM "pins" INNER JOIN "pins_users" ON "pins"."id" = "pins_users"."pins_id" WHERE "pins_users"."user_id" = 102
  
  line 4 :  &lt;%= @user.pinss.count %&gt;
  </code></pre>
  
  <p>(I need to use pinss instead of pins because otherwise rails search the class Pin instead of Pins, but it's so dirty :'( )</p>
  
  <p>Here is my model : </p>
  
  <pre><code>class Pins &lt; ActiveRecord::Base
    attr_accessible :describe, :title, :url_img
    has_and_belongs_to_many :users
  end
  
  class User &lt; ActiveRecord::Base
    attr_accessible :name, :email, :password, :password_confirmation, :team_id
   has_and_belongs_to_many :pinss
  end
  </code></pre>
  
  <p>Thank ! =)</p>
  
  <p>Best.</p>