Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created September 25, 2010 17:11
Show Gist options
  • Save dpickett/597060 to your computer and use it in GitHub Desktop.
Save dpickett/597060 to your computer and use it in GitHub Desktop.
def following_by_type(followable_type, options={})
#might have to const_get here
followable_type.joins("INNER JOIN follows ON follower_type = #{followable_type.name}").where("follows.follower_id = ?", self.id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment