On 31 August 2015 at 18:29, prabhu <[email protected]> wrote:
> Hi Colin,
>
> First of all Sorry for neglecting the previous comments. I didnt notice that
> i had reply for the previous posts which I posted. Thats the reason I posted
> it once again here.
> Thanks for your suggestions.
>
> BTW I was thinking whether polymorphic association would really be nice for
> my scenario

Why?  What advantage would that have over the simple setup I suggested?

Colin

>
> On Monday, 31 August 2015 20:17:26 UTC+5:30, Pradeep Achuthan wrote:
>>
>> Hi,
>>
>> 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.
>>
>> I have User, Expense, Income and UserTransaction models.
>>
>> Expense and Income will have following fields
>>
>>  id, date, category, amount, description, user_id, currency
>>
>> I am not sure whether I need UserTransaction table also.
>> But my business requirement is as follows
>>
>> I should be able to get all expenses/income of a user with date range and
>> also with category
>>
>> I should also be able to get all transactions occurred with date range.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/f4439ded-0ae6-4f4f-b85b-499ab02c8450%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuHe0cVGcPk64Yt2U5ed0C9m22caZ0tYfqMSw6244keYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to