activerecord_where_assoc:使ActiveRecord在关联上执行条件 源码
ActiveRecord哪里Assoc 使用此gem可以轻松地根据ActiveRecord(Rails)中记录的关联来进行条件。 (使用SQL的EXISTS运算符) # Find my_post's comments that were not made by an admin my_post . comments . where_assoc_not_exists ( :author , is_admin : true ) . where ( ... ) # Find every posts that have comments by an admin Post . where_assoc
用户评论