I am building an expense tracker application and I am in middle of data modelling. I have a Users table. Each user will log his expenses with expense type and income with income type. So I need to know how can we set up associations for it.
As per my understanding I have set it up as follows
User has_many :expenses, through: :transactions User has_many :incomes, through: :transactions Expense belongs_to :user Income belongs_to :user
Here I am not sure what the transaction would associate and also expene/income type.
Any suggestions/insights would be great.