David Kimura PRO said about 3 years ago on Like Relationships and Global ID :
  Do you have the associations in your models?

  has_many :users_posts
  has_many :liked_posts, through: :users_posts, source: :post

You can then call user.liked_posts on your instance of the user.