Dealing with old types

R

rmmcgr

Hi,

I often have tables that refernce a sub-table that contain types. e.g.
an addresses table might have a field called "address_type_id" that
references a single row in the "address_types" table.

When I display this information a web page with rails, this is all
fine. However in the address_types table (for example) I would like to
have a boolean column called 'active'. So that if for new records a
particular type should not be selected, I can add criteria to the SQL
that gets the values to populate a drop down list to only get types
where active = 1 (true).

What I would like some input on is how do I deal with legacy records in
the (for example) addresses table. When I display old records that
might reference an address type that has been made in-active (e.g it
references a type that has since had its active field set to 0), it
will not find the value in the drop down list.

Does this make sence?

What would be an elegant solution to this problem in rails?

Thanks for any input,
Regards,
Richard
 
E

Edward Faulkner

--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

a Rails question ... >

You might get an answer if you ask on the Rails list:
http://lists.rubyonrails.org/mailman/listinfo/rails


--J/dobhs11T7y2rNN
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDff1anhUz11p9MSARAhUGAJ0fn2+xVhMboZNxiGSYGYaEBigB1gCaAtzo
6ldjYtuhwAl+xrN26rqcLUM=
=1SR1
-----END PGP SIGNATURE-----

--J/dobhs11T7y2rNN--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,197
Messages
2,571,038
Members
47,633
Latest member
BriannaLyk

Latest Threads

Top