I have one table metrics and another table metric_levels. In the Metric model I have $hasMany = ‘MetricLevels’ but anything inside the MetricLevels model is totally ignored.
But, if I rename the model to ‘Metric’ and have $useTable = ‘metric_levels’ it works fine. I’ve tried all combinations, but none seem to work. I’ve tried plurals, singulars, underscores, nothing seems to work. The model is simply ignored and it just takes the value from the database.
Any help is appreciated.
It is working now. Here is how it is:
The $order = ‘upper_value DESC’ is still being ignored, I don’t know why. But at least it’s now using the correct model.