So, this is my first time using foreign keys, and though I think they are working properly, I don't understand the class\_name portion in the syntax. Is that the class\_name that the table being referred to is in?

My code:

Game Model:

```
belongs_to :user, foreign_key: 'white_player_id', class_name: 'User'
belongs_to :user, foreign_key: 'black_player_id', class_name: 'User'

```

User Model:

```
has_many :games, foreign_key: 'white_player_id', class_name: 'Game'
has_many :games, foreign_key: 'black_player_id', class_name: 'Game'

```

I was looking at: <http://ricostacruz.com/cheatsheets/rails-models.html> and noitced that in their example they have the class name of both belongs\_to and has\_many pointing to the Folder class.. 

```
belongs_to :parent, :foreign_key => 'parent_id' class_name: 'Folder'
has_many :folders, :foreign_key => 'parent_id', class_name: 'Folder'

```

So, that leads me to believe that the class name is supposed to point to the class that contains the foreign\_key?? A little insight would be much appreciated.