```ruby
class Comment < ActiveRecord::Base
  attr_accessible :content
  belongs_to :commentable, polymorphic: true
  belongs_to :user

  validates_presence_of :user_id
end
```

Use validation with association name instead of foreign key
user
```ruby
class Comment < ActiveRecord::Base
  attr_accessible :content
  belongs_to :commentable, polymorphic: true
  belongs_to :user

  validates_presence_of :user
end
```
assistant