title: rails : stack level too deep
body: <p>Actually i'm on a project for a model many->many. I need to find with a current user all credits/devices/project (and I think it's useless to have a table credit with only two column (id &amp; score) so I merge this table to the join table). </p>
  
  <p>I get this error :</p>
  
  <pre><code>SystemStackError in Users#show
  
  Showing app/views/shared/_credit.html.erb where line # raised:
  
  stack level too deep
  </code></pre>
  
  <p>And the two model :</p>
  
  <pre><code>class **Credit** &lt; ActiveRecord::Base
    attr_accessible :created_at, :credit_id, :device_id, :project_id, :score, :user_id
  
  belongs_to :device
  belongs_to :user
  belongs_to :project
  belongs_to :score
  
  end
  
  class **User** &lt; ActiveRecord::Base
  
  has_many :credit
  has_many :credit, :through =&gt; :credit, foreign_key: "user_id", dependent: :destroy
  end
  </code></pre>
  
  <p>Thank !</p>
  
  <p>Best.</p>