BigW Consortium Gitlab

  1. 06 Apr, 2017 4 commits
    • Move a user's abuse reports to the ghost user · 68298754
      Timothy Andrew authored
      ... when the user is destroyed.
      
      To clarify, this regards abuse reports that the to-be-deleted user has _reported_.
    • Fix a bug with the User#abuse_report association. · 6a065074
      Timothy Andrew authored
      Introduction
      ------------
      
      1. The foreign key was not explicitly specified on the association.
      2. The `AbuseReport` model contains two references to user - `reporter_id` and
         `user_id`
      3. `user.abuse_report` is supposed to return the single abuse report where
         `user_id` refers to the given user.
      
      Bug Description
      ---------------
      
      1. `user.abuse_report` would return an abuse report where `reporter_id` referred
         to the current user, if such an abuse report was present.
      
      2. This implies a slightly more serious bug as well:
      
         - Assume User A filed an abuse report against User B
         - We have an abuse report where `reporter_id` is User A and `user_id` is User B
         - If User A is updated (`user_a.block`, for example), the abuse report would
           also be updated, such that both `reporter_id` _and_ `user_id` point to User A.
      
      Fix
      ---
      
      Explicitly declare the foreign key `user_id` in the `has_one` declaration
    • Move a user's notes to the ghost user · 97cbf7c2
      Timothy Andrew authored
      ... when the user is destroyed.
    • Move a user's merge requests to the ghost user. · 72580f07
      Timothy Andrew authored
      1. When the user is deleted.
      
      2. Refactor out code relating to "migrating records to the ghost user" into a
         `MigrateToGhostUser` concern, which is tested using a shared example.
  2. 04 Apr, 2017 3 commits
  3. 03 Apr, 2017 33 commits