trabajo-afectivo/app/models/karma.rb

13 lines
291 B
Ruby
Raw Normal View History

2016-10-19 03:11:36 +00:00
# Copyright (C) 2012-2016 Zammad Foundation, http://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