Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

20 lines (15 sloc) 0.443 kb
class ScoreWorker
extend Resque::Plugins::Retry
@queue = :scores
@retry_limit = 0
@retry_exceptions = []
# Takes a Scorable Type, Scorable ID, and the User ID responsible
def self.perform(scorable_type, scorable_id, user_id)
scorable = scorable_type.constantize.find(scorable_id)
user = User.active.find_by_id(user_id)
if user
score = scorable.add_score(user.id)
user.add_score! score
end
end
end
Jump to Line
Something went wrong with that request. Please try again.