This might be a super newbie question. I've been a happy rails user for quite some time but have been so confused about this:

Why do we need to specify foreign\_key attribute on the model that is being referenced, instead of on a model that is actually referencing it? For example why do we do this:

```
class User < ActiveRecord::Base
  has_many :posts, :foreign_key => author_id

class Post < ActiveRecord::Base
  belongs_to :user

```

instead of

```
class User < ActiveRecord::Base
  has_many :posts

class Post < ActiveRecord::Base
  belongs_to :user, :foreign_key => author_id

```

Maybe i'm missing something but I just thought it would make more sense if foreign\_key is defined as an argument to belongs\_to since `Post` table is where author\_id will be defined in the database. Could someone explain? Thank you

[UPDATE]
Maybe the question was confusing. Let me clarify: I already know WHEN I need to use the foreign\_key attribute, I was asking about the ActiveRecord convention of having that attribute on `User` model instead of `Post` in this particular example.