Declaring static properties of Rails model subclasses
问题 I'm new to Ruby and Rails (and programming!), and trying to figure out the idiomatic way of passing properties from a model to its STI children. I have a generic model 'Document', and some models that inherit from it — let's take 'Tutorial' as the example. I have a string field for an 'icon', in which I want to store the icon's filename but not full path (I think the path should be up to each model, as it's a detail of retrieving the record's data?): class Document < ActiveRecord::Base attr