I have 3 models:
Tiersets
has_many Tiers
Tiers
belongs_to Tierset
has_and_belongs_to_many Features
Feature
has_and_belongs_to_many Tiers
In Feature
, I have a String
column named Feature_Code
that contains one of the following strings: "F_VIZ
", "F_DATA
", "F_SCORE
".
I'm trying to construct a query to find, within a known Tierset
, all the Feature
objects with code F_VIZ
in all Tier
objects for that Tierset
.
I've tried a bunch of combinations of :includes in AREL queries, but I'm clearly getting mixed up with how the tables are joined. Any help is much appreciated.