FIX: Always return 0 for non-human user current DraftSequence.

This commit is contained in:
Guo Xiang Tan
2020-05-15 10:39:39 +08:00
parent 245e8212ca
commit 165fa13c9d
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class DraftSequence < ActiveRecord::Base
user_id = user
user_id = user.id unless user.is_a?(Integer)
return nil if invalid_user_id?(user_id)
return 0 if invalid_user_id?(user_id)
# perf critical path
r, _ = DB.query_single('select sequence from draft_sequences where user_id = ? and draft_key = ?', user_id, key)