On my previous countless Rails apps, I've always put each data field
as its own column in the DB, but on the last 2 projects, I've started
to create a catch-all column that is a MySQL TEXT that I serialize and
treat as a hash for a bunch of general stuff, from arrays, hashes,
etc.

This has worked well on the last 2 apps whose requirements were not
firm, so there are lots of changes on the fly.

So when there is a data field for a model that I know I'm going to
want to do a find_by..., order, or some other database operation on, I
obviously put it into its own SQL column, but otherwise, I've been
lumping everything else into that general serialized hash and setting
up methods in the model to get/set them as if they were normal
attributes.

I'm curious to hear some feedback on this technique, e.g. "that bad
programming practice because..." or "it has a performance impact
because..." or "hey, me too"


--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to