diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-04 11:51:12 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-09-19 19:50:40 +0300 |
commit | 412ff80b7b1381485a306df240aab020e9b90801 (patch) | |
tree | c1bc93bef0f316131aa36dfef0963aa6a4fb0961 /app/models/concerns/awardable.rb | |
parent | fe0433984c7a089341d0f8b682dbe40d9dab2dec (diff) |
Start Frontend work, fix routing problem
Diffstat (limited to 'app/models/concerns/awardable.rb')
-rw-r--r-- | app/models/concerns/awardable.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/concerns/awardable.rb b/app/models/concerns/awardable.rb index d8d4575bb4d..073ac4c1b65 100644 --- a/app/models/concerns/awardable.rb +++ b/app/models/concerns/awardable.rb @@ -71,6 +71,12 @@ module Awardable end end + def user_authored?(current_user) + author = self.respond_to?(:author) ? self.author : self.user + + author == current_user + end + def awarded_emoji?(emoji_name, current_user) award_emoji.where(name: emoji_name, user: current_user).exists? end |