views:

23

answers:

1

This is my common model which has no table.

class CommonActiveRecord < ActiveRecord::Base

  self.abstract_class = true

  def before_validation
    set_blank_attributes_to_nil(@attributes)
  end

end

My other models look like this ..

class BalanceName < CommonActiveRecord

  def before_validation
    super
  end

end

I want to fetch all superclasses of BalanceName..

This command is returning only one level superclass

>> BalanceName.superclass
=> CommonActiveRecord(abstract)

how may i get hierarchy of superclasses ??

+2  A: 
BalanceName.ancestors will give you an array of all superclasses
ennuikiller