Skip to content

DSL for Parse::Query#in_query #57

Open
@adelevie

Description

@adelevie

Here's the current usage:

Assume I have the classes Post, Tags, and PostTags (which joins the first two).
def in_query(field, query)
query_hash = {Parse::Protocol::KEY_CLASS_NAME => query.class_name, "where" => query.where}
add_constraint(field, "$inQuery" => query_hash)
self
end

post_tags = Parse::Query.new("PostTag").tap do |q|
  q.in_query("tag", Parse::Query.new("Tag").tap do |tq|
    tq.eq("category", "Person")
  end)
end.get

And here's what I propose:

post_tags = Parse::Query.new("PostTag").tap do |q|
  q.in_query("tag") do |tag_query|
    tag_query.eq("category", "Person")
  end
end.get

Is this something anyone (@ericcj, @jamonholmgren) would want?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions