merge で scope を指定すればOK。
user.rb
has_many :team_members
has_many(
:pro_team_member,
-> { merge(Team.pro) },
through: :team_members,
source: :team,
)
「何をもってproとするか」は、 Team
側が持つべき知識なので、 User
側で無闇に where(pro: true)
みたいなコードを書くのは避けた方がよいです。
ドメイン知識が他のオブジェクトに流出している感じがするので。