module Sequel::Plugins::Subclasses::ClassMethods

  1. lib/sequel/plugins/subclasses.rb


on_subclass [R]

Callable object that should be called with every descendent class created.

subclasses [R]

All subclasses for the current model. Does not include the model itself.

Public Instance methods


All descendent classes of this model.

[show source]
   # File lib/sequel/plugins/subclasses.rb
54 def descendents
55   Sequel.synchronize{subclasses.dup}.map{|x| [x] + x.send(:descendents)}.flatten
56 end

Freeze all descendent classes. This also finalizes the associations for those classes before freezing.

[show source]
   # File lib/sequel/plugins/subclasses.rb
60 def freeze_descendents
61   descendents.each(&:finalize_associations).each(&:freeze)
62 end