Skip to content
Snippets Groups Projects
Commit 00be106e authored by Felipe Artur's avatar Felipe Artur
Browse files

Do not remove issues/comments when deleting users

parent 74849f97
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -70,13 +70,13 @@ class User < ActiveRecord::Base
 
has_many :snippets, dependent: :destroy, foreign_key: :author_id, class_name: "Snippet"
has_many :project_members, dependent: :destroy, class_name: 'ProjectMember'
has_many :issues, dependent: :destroy, foreign_key: :author_id
has_many :notes, dependent: :destroy, foreign_key: :author_id
has_many :issues, foreign_key: :author_id
has_many :notes, foreign_key: :author_id
has_many :merge_requests, dependent: :destroy, foreign_key: :author_id
has_many :events, dependent: :destroy, foreign_key: :author_id, class_name: "Event"
has_many :subscriptions, dependent: :destroy
has_many :recent_events, -> { order "id DESC" }, foreign_key: :author_id, class_name: "Event"
has_many :assigned_issues, dependent: :destroy, foreign_key: :assignee_id, class_name: "Issue"
has_many :assigned_issues, foreign_key: :assignee_id, class_name: "Issue"
has_many :assigned_merge_requests, dependent: :destroy, foreign_key: :assignee_id, class_name: "MergeRequest"
has_many :oauth_applications, class_name: 'Doorkeeper::Application', as: :owner, dependent: :destroy
has_one :abuse_report, dependent: :destroy
Loading
Loading
- return unless note.author
- note.author = User.new unless note.author
- return if note.cross_reference_not_visible_for?(current_user)
 
- note_editable = note_editable?(note)
%li.timeline-entry{ id: dom_id(note), class: ["note", "note-row-#{note.id}", ('system-note' if note.system)], data: {author_id: note.author.id, editable: note_editable} }
.timeline-entry-inner
.timeline-icon
%a{href: user_path(note.author)}
= image_tag avatar_icon(note.author), alt: '', class: 'avatar s40'
- if note.author.valid?
.timeline-icon
%a{href: user_path(note.author)}
= image_tag avatar_icon(note.author), alt: '', class: 'avatar s40'
.timeline-content
.note-header
= link_to_member(note.project, note.author, avatar: false)
- if note.author.valid?
= link_to_member(note.project, note.author, avatar: false)
.inline.note-headline-light
= note.author.to_reference
- unless note.system
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment