trabajo-afectivo/app/models/karma.rb

12 lines
290 B
Ruby
Raw Normal View History

2016-07-10 22:47:21 +00:00
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
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
last_activity_log.score_total
end
end