For normal columns, you can get at them via the columns class method. However, associations may be named something quite different if the foreign_key
columns
foreign_key
For an ActiveRecord object I use:
object._reflections
So, I can manipulate the Hash returned. For instance:
object._reflections.keys.each do |key| object.public_send(key).destroy_all end
The above example delete all the relationships from database.