On 17 December 2015 at 23:35, Travis Eubanks <[email protected]> wrote: >> Is the gl code a unique number that identifies the type? If so then >> that should be stored in the db but the string should not, since it >> can be determined from the string. Alternatively put the string in >> the db and not the code. It is almost always a bad idea to store >> redundant data in the db. >> > > Yeah, the gl_code will be a set number. For instance all travel > expenses will have a gl code of 8907 and all employee meals will have a > gl code of 5201 and so on. > > Cause I'd like when a user chooses a type of expense that that expenses > gl_code will be saved as appropriate. > > This is because the final step in the reporting is to gather the total > cost of each gl code and display it. Some expenses share the same gl > code too.. make sense ?
It is important to separate user interface issues from database issues. There is no need (from what I understand) to have both name and gl code in the database as if you (the programmer) knows one then you are able to determine the other. If you want both on the UI then that is no problem, just work the other one out when you need to display it. 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%3D0gLsubLgrGWwnW2pP2GgG-cHRDpJZ%3DVU9b3rmpK5bjhM6Yg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

