How complex a query can ActiveRecord handle before it’s better using Raw
or a View???
I need to calculate for example taxable income via a query going across
tables. Some like this: Find all transaction records (transactions
for which they are allocated (via allocation table) to person X (person
table), for transaction dates within date1 & date2, for which the
category (categories table) associated with transaction, has a tax_id
tax_codes table) of XYZ. I will need to reuse this type of query as I
a report of various tax categories.
Question - What would Rails best practice way for the above?
[I’m thinking best to create a flat view of this and use this to then query against]