From: Perry Smith Date: 2008-02-02T09:52:26+09:00 Subject: Ancestor paths ActiveRecord does this "trick". For a normal object, this dump routine: def dump(name, obj) puts "#{name}'s ancestors: #{obj.class.ancestors.inspect}" puts "#{name}'s funky ancestors: #{(class << obj; self; end).ancestors.inspect}" end produces the same list for ancestors and funky ancestors. For an ActiveRecord Association, you get something like this: temp's ancestors: [ Cached::Queue ActiveRecord::Locking::Pessimistic, ActiveRecord::Locking::Optimistic, ActiveRecord::Validations, Object, Socket::Constants, InstanceExecMethods, Base64::Deprecated, Base64, Kernel] temp's funky ancestors: [ActiveRecord::Associations::BelongsToAssociation, ActiveRecord::Associations::AssociationProxy, Object, Socket::Constants, InstanceExecMethods, Base64::Deprecated, Base64, Kernel] Can someone tell me how this is done or point me to the code in active record? Thank you very much, Perry -- Posted via http://www.ruby-forum.com/.