Skip to content

Instantly share code, notes, and snippets.

@lynndylanhurley
Last active January 25, 2020 18:45
Show Gist options
  • Save lynndylanhurley/889abbe9f92d227eafcabb1f9b562f5e to your computer and use it in GitHub Desktop.
Save lynndylanhurley/889abbe9f92d227eafcabb1f9b562f5e to your computer and use it in GitHub Desktop.
let(:index_req) do
{
data: {
appContentScope: {
id: app_scope.id,
fields: ['name'],
include: {
categoryAppContentScopes: {
filter: { appContentScopeId: { fromContext: 'appContentScope.id' } },
sort: [{ field: 'position', direction: 'asc' }],
fields: %w[appContentScopeId categoryId position],
include: {
category: {
id: { fromContext: 'categoryAppContentScope.categoryId' },
fields: ['name'],
include: {
deckCategories: {
filter: { categoryId: { fromContext: 'category.id' } },
sort: [{ field: 'position', direction: 'asc' }],
fields: %w[position deckId categoryId deckType],
include: {
deck: {
id: { fromContext: 'deckCategory.deckId' },
if: { attribute: { fromContext: 'deckCategory.deckType' },
matches: 'Deck' },
fields: ['name']
},
quizDeck: {
id: { fromContext: 'deckCategory.deckId' },
if: { attribute: { fromContext: 'deckCategory.deckType' },
matches: 'QuizDeck' },
fields: ['name']
}
}
}
}
}
}
}
}
}
}
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment