     Ember.merge(litePaperAttrs, attrs)
 
   addRecordToManifest: (manifest, typeName, obj, isPrimary) ->
+    # the allRecords array allows easy modification of a given
+    # record later
+    manifest.allRecords ||= []
+    manifest.allRecords.addObject(obj)
+
     manifest.types ||= {}
     types = manifest.types
     typeArray = types[typeName]

ETahi.Factory =

  create: (type, attrs) ->
    Ember.merge(ETahi.FactoryAttributes[type], attrs)

  createLitePaper: (paper, attrs) ->
    {short_title, title, id, submitted} = paper



ETahi.FactoryAttributes = {}
ETahi.FactoryAttributes.user =
  rootKey: 'user'
  attributes:
    id: 1
    full_name: "Fake User"
    avatar_url: "/images/profile-no-image.png"
    username: "fakeuser"
    email: "fakeuser@example.com"
    admin: false
    affiliation_ids: []
ETahi.FactoryAttributes.journal =
  rootKey: 'journal'
  attributes:
    id: 1
    name: "Fake Journal"
    logo_url: "/images/no-journal-image.gif"
    paper_types: ["Research"]
    task_types: [
      "ReviewerReportTask"
      "PaperAdminTask"
      "UploadManuscript::Task"
      "PaperEditorTask"
      "Declaration::Task"
      "PaperReviewerTask"
      "RegisterDecisionTask"
      "StandardTasks::TechCheckTask"
      "StandardTasks::FigureTask"
      "StandardTasks::AuthorsTask"
      "SupportingInformation::Task"
      "DataAvailability::Task"
      "FinancialDisclosure::Task"
      "CompetingInterests::Task"
    ]
    manuscript_css: null

ETahi.FactoryAttributes.paper =
  rootKey: 'paper'
  attributes:
    id: 1
    short_title: "Paper"
    title: "Foo"
    body: null
    submitted: false
    paper_type: "Research"
    status: null
    phase_ids: []
    figure_ids: []
    author_group_ids: []
    supporting_information_file_ids: []
    assignee_ids: []
    editor_ids: []
    reviewer_ids: []
    tasks: []
    journal_id: 1

ETahi.FactoryAttributes.litePaper =
  rootKey: 'lite_paper'
  attributes:
    id: 1
    title: "Foo"
    paper_id: 1
    short_title: "Paper"
    submitted: false

ETahi.FactoryAttributes.messageTask =
  rootKey: 'task'
  attributes:
    id: 1
    title: "Message Time"
    type: "MessageTask"
    completed: false
    body: null
    paper_title: "Foo"
    role: "author"
    phase_id: null
    paper_id: null
    lite_paper_id: null
    assignee_ids: []
    assignee_id: null
    participant_ids: []
    comment_ids: []

ETahi.FactoryAttributes.comment =
  rootKey: 'comment'
  attributes:
    id: 1
    commenter_id: 1
    message_task_id: 1
    body: "A sample comment"
    created_at: null
    comment_look_id: null

ETahi.FactoryAttributes.phase =
  rootKey: 'phase'
  attributes:
    id: 1
    name: "Submission Data"
    position: 1
    paper_id: 1
    tasks: []
