The code shown in your post should certainly work, but it doesn’t include any distinction between the different kinds of Buildable. Assuming there is a type on Buildable as @zwippie did, you could filter the associations with where:
has_many :single_family_homes, Buildable, where: [type: "single_family_home"]
etc
See also the note under “Important!” at the bottom of that section.






















