diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-06 17:11:36 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-05-06 17:11:36 +0000 |
commit | cc01aa4fd59ed0401d4c9e1526e3ac6ddd866e53 (patch) | |
tree | f926b1b7fcb26527bb55940fda2a017314fd3c01 /app/models/note.rb | |
parent | eb7bdeb5c8619b61181a9348c7aa94a2be1615bb (diff) | |
parent | 2e6201b13197d03eafecd18d967ba7d55f664e19 (diff) | |
download | gitlab-ce-enable-auto-cancelling-by-default.tar.gz |
Merge branch 'master' into 'enable-auto-cancelling-by-default'enable-auto-cancelling-by-default
# Conflicts:
# spec/workers/post_receive_spec.rb
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index b06985b4a6f..46d0a4f159f 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -18,6 +18,11 @@ class Note < ActiveRecord::Base cache_markdown_field :note, pipeline: :note, issuable_state_filter_enabled: true + # Aliases to make application_helper#edited_time_ago_with_tooltip helper work properly with notes. + # See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10392/diffs#note_28719102 + alias_attribute :last_edited_at, :updated_at + alias_attribute :last_edited_by, :updated_by + # Attribute containing rendered and redacted Markdown as generated by # Banzai::ObjectRenderer. attr_accessor :redacted_note_html @@ -38,6 +43,7 @@ class Note < ActiveRecord::Base belongs_to :noteable, polymorphic: true, touch: true belongs_to :author, class_name: "User" belongs_to :updated_by, class_name: "User" + belongs_to :last_edited_by, class_name: 'User' has_many :todos, dependent: :destroy has_many :events, as: :target, dependent: :destroy |