VRFS-1577 VRFS-736 added should_rate_session?; fixed bug in add_rating

This commit is contained in:
Jonathan Kolyer 2014-05-01 01:46:57 +00:00
parent 2cbfae2215
commit 5e27268fa4
1 changed files with 6 additions and 1 deletions

View File

@ -105,10 +105,15 @@ module JamRuby
def add_rating(rval, comment='')
rval = rval.to_i
if 0 != rval
self.rating += rval
self.rating = self.rating.to_i + rval
self.rating_comment = comment
end
end
def should_rate_session?
2 <= music_session_history.unique_users.count &&
60 < (Time.now - music_session_history.created_at).seconds
end
end
end