Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

support read=false on paged contents query #103

Description

@mydearxym

when query read=true, i can use:

read == true ->
   queryable
   |> join(:inner, [content, f, c], viewers in assoc(content, :viewers))
   |> where([content, f, c, viewers], viewers.user_id == ^user.id)

but came to read=false, this is not work as except

read == true ->
   queryable
   |> join(:inner, [content, f, c], viewers in assoc(content, :viewers))
   |> where([content, f, c, viewers], viewers.user_id != ^user.id)

because the viewers assoc only have records of viewed user, the unviewed user is not in that table
left_join is not working either, need help...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions