On 18 December 2015 at 15:31, Travis Eubanks <[email protected]> wrote: >> That was not what I thought you were doing, I thought you were just >> going to include the gl_code in the expenses table. However there may >> well be an argument for having an expense_types table with >> Expense belongs_to expense_type >> ExpenseType has_many expenses > > I think this is the most appropriate way to handle this at this stage. > Then I'll just build all the possible expense types that our company > allows in the database so the dropdown would make sense then.. > > EXPENSE > occurrence > cost > description > expense_type_id > > EXPENSE_TYPE > name > gl_code > > > Grab an expense type > e = ExpenseType.where(gl_code: 9090) > > display me the expenses that relate to this gl_code > e.expenses
Looks good to me. Colin -- 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%3D0gLvkUeMgtZK3r4wpyWoAAXZH8EZibbX%2BRJwRG3M6pje6SQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

