I’m considering porting an application to RoR. The application is
basically a “Order Entry” type system for the Interior Designer
vertical market. The existing application has a table with over 400
column! (not my design!). The majority of these columns are
measurements and descriptions for a certain types of product
categories (e.g., “Draperies”,“Sheer Draperies”,
Each one of these categories (25+) has a custom form that display the
measurement attributes for that category. To make things worse,
fields. There is some sharing of attributes (width, height, length,
categories - for instance there are 3 types of “Sheer Draperies”.
I alway though that these “Category Details” didn’t need to be stored
individually in a record, but serialized in a “Details” fields. Now
the basic question is what would be the best approach?
I’ve never done xml/xslt type forms and don’t know how difficult that
I’ve experimented with what could be considered “Tableless STI” and it
works, but with a few gotcha’s. For instance:
class Detail < ActiveRecord::Base
@columns ||= ;
… rest of tableless stuff
column :type, :string
column :category, :string
column :workroom_material_reference, :text
column :description, :string
class Carpet < Detail
column :style, :string
column :quanity, :integer
column :yards, :float
The tableless approach would not allow me to create a new Carpet
without first doing Detail.new. There were other problems that I
hacked around, like defining def self.new_category(category) that
creates new ActiveRecord objects for both the basic attributes and the
category attributes. Maybe if I used a real table, some of those
problems would go away.
That approach is livable, but was wondering if I am totally missing a
Anyway, I know I am still going to have a couple hundred date elements
to deal with and a bunch of partials.
Anyone want to point me in a different direction?