Get all associations of an ActiveRecord class

YourClass.reflect_on_all_associations.map(&:name)

Get the class name by calling class_name, or the type of the association (belongs_to, has_many,...) by calling macro