trabajo-afectivo/app/models/karma.rb

13 lines
292 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
2016-07-10 22:47:21 +00:00
class Karma
def self.score_by_user(user)
last_activity_log = Karma::ActivityLog.where(user_id: user.id).order(id: :desc).first
return 0 if !last_activity_log
2016-07-10 22:47:21 +00:00
last_activity_log.score_total
end
end