STI vs CTI vs something else?

Hey gang,

I have these classes:

class Image < UploadFile
validates_file_format_of :filename, :in => [“gif”, “png”, “jpg”]

class UploadFile < PropertyItem
file_column :filename
validates_presence_of :filename

class PropertyItem < ActiveRecord::Base
validates_presence_of :name

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…


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