> 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

-- 
Posted via http://www.ruby-forum.com/.

-- 
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/92df272a6be0e0e7499800938999bfcc%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to