# STI vs CTI vs something else?

**URL:** <https://www.ruby-forum.com/t/sti-vs-cti-vs-something-else/118175>\
**Category:** Rails\
**Created:** [October 24, 2007, 2:11pm UTC](https://www.ruby-forum.com/t/sti-vs-cti-vs-something-else/118175 "2007-10-24T14:11:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/3ab097/32.png) [@bartz](https://www.ruby-forum.com/u/bartz)\
**Post date:** [October 24, 2007, 2:11pm UTC](https://www.ruby-forum.com/t/sti-vs-cti-vs-something-else/118175/1 "2007-10-24T14:11:45Z")

</div>

Hey gang,

I have these classes:

class Image \< UploadFile  
validates\_file\_format\_of :filename, :in =\> [“gif”, “png”, “jpg”]  
end

class UploadFile \< PropertyItem  
file\_column :filename  
validates\_presence\_of :filename  
end

class PropertyItem \< ActiveRecord::Base  
validates\_presence\_of :name  
end

What I’m trying to achieve is a class inheritance tree with multiple  
STIs. So, Image would have a column caption:string in it’s table, and  
UploadFile a column fiilename:string, whereas PropertyItem would have  
created\_at, updated\_at and such.  
Is this possible at all? I’m really stumped…

thanks!
