summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-07 15:00:58 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-05-07 15:00:58 +0100
commit842918602dbe622dc20593c0abea5293e304ac62 (patch)
treec748164aab8cfa43fe3332640c60e3308b4e9c29 /app/models/snippet.rb
parent214d7880c3d651b367eb73651a6e0e3046868287 (diff)
parent6ad3814e1b31bfacfae7a2aabb4e4607b12ca66f (diff)
downloadgitlab-ce-remove-old-isobject.tar.gz
Merge branch 'master' into remove-old-isobjectremove-old-isobject
* master: (226 commits) Real time pipeline show action Fix `Routable.find_by_full_path` on MySQL add CHANGELOG.md entry for !11138 add tooltips to user contrib graph key Use an absolute path for locale path in FastGettext config Colorize labels in issue search field Fix Karma failures for jQuery deferreds Reduce risk of deadlocks Fix failing spec and eslint Resolve discussions Resolve discussions Dry up routable lookups. Fixes #30317 Add “project moved” flash message on redirect Resolve discussions Fix Rubocop failures Index redirect_routes path for LIKE Add index for source association and for path Fix or workaround spec failure Refactor Delete conflicting redirects ...
Diffstat (limited to 'app/models/snippet.rb')
-rw-r--r--app/models/snippet.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index d8860718cb5..abfbefdf9a0 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -12,6 +12,11 @@ class Snippet < ActiveRecord::Base
cache_markdown_field :title, pipeline: :single_line
cache_markdown_field :content
+ # Aliases to make application_helper#edited_time_ago_with_tooltip helper work properly with snippets.
+ # 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
+
# If file_name changes, it invalidates content
alias_method :default_content_html_invalidator, :content_html_invalidated?
def content_html_invalidated?