私は、友人を表すユーザーモデルの標準的な自己参照関係を持っています。その部分は正常に機能しますが、結合テーブルにその関係のソースを表す追加の列があります。
友情モデル
# Relationships
belongs_to :user
belongs_to :friend, :class_name => "User"
has_one :source
ユーザーモデル
has_many :friendships
has_many :friends, :class_name => "User", :through => :friendships
ユーザーの友達にwhereフィルターを実行できることを理解しています
user.friends.where([some conditions])
私の質問は、Friendshipの:source関係によってフィルタリングされたユーザーオブジェクト「friends」のリストを取得するにはどうすればよいですか?