Need help understanding self.abstract_class = true in AR

1) read my response to the ticket:

An abstract model means you can inherit from it without using STI.

class SuperModel < AR::Base   self.abstract_class = true end

class Foo < SuperModel end

Foo.table_name # => 'foos'

It's used in the CachedModel plugin. I'm not sure why it's a class and not a mixin though, but ok.

2) Two ideas, one is really hackish.

The hackish way:

http://rails.techno-weenie.net/tip/2005/11/19/validate_your_forms_with_a_table_less_model

The second is directly including ActiveRecord::Validations into your class. You may have to implement some of the ActiveRecord API for this though. I'm pretty sure the wiki has some info on this.

As Rick said, setting self.abstract_class = true means you can extend a class without STI kicking in. The class isn't really abstract in the strict sense; it can still be instantiated (whichever database adapter is used). Perhaps base_class or some other signifier (acts_as_base_class?) would have been less confusing.

Tom