Module: E9Rails::ActiveRecord::STI::ClassMethods

Defined in:
lib/e9_rails/active_record/sti.rb

Instance Method Summary collapse

Instance Method Details

#subclassesObject



11
12
13
# File 'lib/e9_rails/active_record/sti.rb', line 11

def subclasses
  descendants
end

#subclasses_with_ancestor(mod) ⇒ Object



15
16
17
# File 'lib/e9_rails/active_record/sti.rb', line 15

def subclasses_with_ancestor(mod)
  subclasses.select {|klass| klass.ancestors.include?(mod) }
end