Guest User

Untitled

a guest
May 26th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. class Topic
  2.  
  3. has n, :article_topics
  4. has n, :articles, :through => :article_topics
  5.  
  6. def associated_articles association_type
  7. Article.all :conditions => ["(`article_topics`.`association_type` = ?)", association_type]
  8.  
  9. # I want to do this
  10. Article.all 'article_topics.association_type' => association_type
  11. # But DM complains that 'article_topics.association_type' is not a property
  12. # Design? or Bug?
  13. end
  14. end
Add Comment
Please, Sign In to add comment