Association for polymorphic belongs_to of a particular type
I'm relatively new to Rails. I would like to add an association to a model that uses the polymorphic association, but returns only models of a particular type, e.g.: class Note < ActiveRecord::Base # The true polymorphic association belongs_to :subject, polymorphic: true # Same as subject but where subject_type is 'Volunteer' belongs_to :volunteer, source_association: :subject # Same as subject but where subject_type is 'Participation' belongs_to :participation, source_association: :subject end I've tried a vast array of combinations from reading about the associations on ApiDock but nothing