I have the following models:
class User < ActiveRecord::Base has_many :memberships has_many :groups, :through => :memberships end class Group < Act
something like this should work for you, although it requires mixing in a little raw SQL
Post .joins("INNER JOIN memberships ON memberships.group_id = posts.group_id") .where(:memberships => {:user_id => current_user.id})