njmacinnes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Sep-30 16:12 UTC
Hardcoding things related to data in the database
Hi, What do people think about hardcoding stuff related to data in the database? Obviously, there are some things which you have no choice abnout, but where it can be avoided, should it? I would think so, but I don''t really have the experience to know if it really is something to avoid. Let me give an example (albeit very vague) of what I mean. An object in your model can be type 1 or type 2 (stored in the ''type'' field in the class''s table). One type requires one layout in the view, and another requires a completely different layout. Obviously this is one case where hardcoding can''t be avoided, which means that if you want to add a third type, you have to change your code. But if it can be avoided by, say, adding an extra two tables to your database, should you? Hope you all understand what I mean. -Nathan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---