If I want to return SQL data that cuts across multiple models (e.g.
not specific to one mode) how do I do this? Actually the use case
could be either (a) custom SQL I want to call or via (b) SQL call to a
database view I’ve created?
If I want to return SQL data that cuts across multiple models (e.g.
not specific to one mode) how do I do this? Actually the use case
could be either (a) custom SQL I want to call or via (b) SQL call to a
database view I’ve created?
If I understand your question then the way to do this is through
associations defined in your model. You can have more than one
association defined between identical tables, each with a different name
and select conditions.