module Sequel::Plugins::Subclasses::ClassMethods

  1. lib/sequel/plugins/subclasses.rb

Methods

Public Instance

  1. descendants
  2. freeze_descendants
  3. on_subclass

Public Instance Aliases

descendents -> descendants

SEQUEL6: Remove

freeze_descendents -> freeze_descendants

SEQUEL6: Remove

Attributes

on_subclass [R]

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

Public Instance methods

descendants()

All descendent classes of this model.

[show source]
   # File lib/sequel/plugins/subclasses.rb
63 def descendants
64   Sequel.synchronize{subclasses.dup}.map{|x| [x] + x.send(:descendants)}.flatten
65 end
freeze_descendants()

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

[show source]
   # File lib/sequel/plugins/subclasses.rb
72 def freeze_descendants
73   descendants.each(&:finalize_associations).each(&:freeze)
74 end