Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mirage Includes & Relationship Records

Mirage Includes

The way mirage mocks out our included records isn't accurate currently.

An example: In a request for addon, it includes some information about the relationship to company.

The "relationship object" we get looks like

company: { id: 123 }

not

company: 123

Mirage#include

include: ['company', 'categories']
company: {
  id: 123,
  name: "Add-on Company Name",
  email_admin: "the_admin@companyname.com"
}

Mirage#includeIds

include: ['company', 'categories'],
company: 123

not the format our API sends things in ^

HerokuMirageSerializer#includeRelationshipObject

include: ['company', 'categories'],
includeOnlyRelationshipObject: ['company']
company: { id: 123 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.