My Object has many transactions which belong to a type, whcich then belong to a group. I would like to pull all the transactions from my Object which are in a specific group, say blue.
Been trying to do this using both SQL and Activerecord and have failed in both endeavors.
I can get this procedure to print out the quality by which I then want to sort by:
object.transactions.map { |to| "#{to.transaction_type.transaction_group.name}" }
And here is a sample of what i have been running, but oviously dosen’t work. Haven’t managed to find a way to
id = Group.find_by_name("name")
object.transactions.where(transaction_type.group_id == id)
Can you do something like: