Storing attribute legal values in model and/or database

I have a rails application which has a table ‘cells’ which contains some
80 or
so attribute fields (related to the electrical characteristics of macros
are hooked together, instantiated in silicon and become microchips).

I want to also store the legal values for many of those attribute fields
another database table. The problem is that

  1. the sub-set of attributes that apply to each cell is dependent on the
    of certain key cell attributes
    (eg. if the value of the library attribute is ‘xx00’, then certain
    fields will not apply)


  1. the legal values of many of the attributes will vary depending on the
    of other attributes
    (eg. if the value of the ‘cell_type’ attribute is ‘blah’ then the
    legal values
    for attribute ‘foo’ are [abc, def, ghi], otherwise they are [abc,

I get the whole notion of single inheritance tables which I will need to
use here;
what I don’t get is how I can model these dependencies in the database.

Can anyone share a similar need they had and how they handled it.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs