title: has_many and belongs_to of the same model
body: <p>I am pretty new to rails. I am trying to figure out the most efficient way to create a relationship between two models that states:</p>
  
  <ol>
  <li>A user can "favorite" many songs</li>
  <li>A song has an owner.</li>
  </ol>
  
  <p>This is what I am thinking of doing. Does it make sense ?</p>
  
  <pre><code>class User &lt; ActiveRecord::Base
      has_many :songs #songs this user has favorited
  end
  
  class Song &lt; ActiveRecord::Base
      belongs_to :user #the user whom submitted this song
  end
  </code></pre>
  
  <p>My concern about this method is that I'm unsure about the efficiency of doing query on every song in the database just to figure out which songs a particular user owns. Is there a different way I should be thinking about this ? </p>
  
  <p>By the way, is there a method by which I can call the attribute something different than it's model name. So rather than <code>User.find(1).songs[0]</code> I could say <code>User.find(1).favorites[0]</code> even though the model is still a "Song". </p>