diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-11-21 12:54:55 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-11-21 12:54:55 +0000 |
commit | 671c6d7d577d6b872bee7634c4eaf6b4da16919f (patch) | |
tree | dd42a8956b92aefbd270f1696d30b358a48f07bd /app/models | |
parent | 0be557331d8341fef473ca59e63116ef60f400e6 (diff) | |
parent | 452d1d0824f44664484c35a2acc7c008c8167196 (diff) | |
download | gitlab-ce-671c6d7d577d6b872bee7634c4eaf6b4da16919f.tar.gz |
Merge branch 'ee-870-backport' into 'master'
Backport some changes done from Time Tracking feature in EE.
See merge request !7604
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/concerns/issuable.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index ec9e7e5ae2b..69d8afc45da 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -251,6 +251,17 @@ module Issuable self.class.to_ability_name end + # Convert this Issuable class name to a format usable by notifications. + # + # Examples: + # + # issuable.class # => MergeRequest + # issuable.human_class_name # => "merge request" + + def human_class_name + @human_class_name ||= self.class.name.titleize.downcase + end + # Returns a Hash of attributes to be used for Twitter card metadata def card_attributes { |