Meta code

Get the list of all associations defined on a Model

Doctor.reflections.collect{|a, b| {b.macro => b.class_name}}.compact

#=>
[
	  {:has_many=>"Device"}, 
	  {:has_many=>"Call"}, 
	  {:has_many=>"Feedback"}, 
	  {:has_one=>"Document"}
]

List of all callbacks

ActiveRecord::Callbacks::CALLBACKS

Thanks for reading!!!

comments powered by Disqus