ruby on rails - ActiveRecord: Is there a method to get the type of association between two classes? -


something like:

post.association(comment) => :has_many 

yes. use *reflect_on_association*

post.reflect_on_association(:comments).macro 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -