# Dealing with old types

**URL:** <https://www.ruby-forum.com/t/dealing-with-old-types/48250>\
**Category:** Ruby\
**Created:** [November 18, 2005, 6:14am UTC](https://www.ruby-forum.com/t/dealing-with-old-types/48250 "2005-11-18T06:14:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.mcgrath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@richard.mcgrath](https://www.ruby-forum.com/u/richard.mcgrath)\
**Post date:** [November 18, 2005, 6:14am UTC](https://www.ruby-forum.com/t/dealing-with-old-types/48250/1 "2005-11-18T06:14:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![richard.mcgrath](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@richard.mcgrath](https://www.ruby-forum.com/u/richard.mcgrath)\
**Post date:** [November 18, 2005, 5:13pm UTC](https://www.ruby-forum.com/t/dealing-with-old-types/48250/2 "2005-11-18T17:13:27Z")

</div>

On Fri, Nov 18, 2005 at 02:12:19PM +0900, rmmcgr wrote:  
\< … a Rails question … \>

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