summaryrefslogtreecommitdiff
path: root/app/models/snippet.rb
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-05-04 14:54:25 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2017-05-04 14:54:25 +1100
commit154610c92bec0f94067ab88f35c5afdf6f10791d (patch)
tree1af12f04430ca6f596e4cfb8ccc69406db493830 /app/models/snippet.rb
parentb2e578803dce182bd8d871fa7bcac573e05c4b95 (diff)
downloadgitlab-ce-154610c92bec0f94067ab88f35c5afdf6f10791d.tar.gz
Fix feature tests
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?