Pattern: Redundant :foreign_key
option
Issue: -
Checks for associations where the :foreign_key
option is redundant.
# bad
class Post
has_many :comments, foreign_key: 'post_id'
end
class Comment
belongs_to :post, foreign_key: 'post_id'
end
# good
class Post
has_many :comments
end
class Comment
belongs_to :author, foreign_key: 'user_id'
end