対象者 rails tutorial14章取り組んでいる方 コードの意味 user.rb class User < ApplicationRecord has_many :following, through: :active_relationships, source: :followed end このコードを見て混乱したので理解を定着させたいので記事にします。 前提(以下のような状態) 今2つテーブル(UserテーブルとRelationshipテーブル)があり多対多の関係である 要はUserテーブルの外部キー(user_id)をRelationshipテーブルでfollower_idとfo…