VRFS-1577 VRFS-736 added should_rate_session?; fixed bug in add_rating
This commit is contained in:
parent
2cbfae2215
commit
5e27268fa4
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue