Skip to content

Commit

Permalink
refs #4 iidxmeの同期に関する不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
8398a7 committed Jun 29, 2015
1 parent 11aa3a1 commit d3629f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/concerns/iidxme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ def self.iidxme_async(user_id, elems)
sheet = Sheet.find_by(title: title)
next unless sheet
state = reverse(elem['clear'])
next if user.scores.find_by(sheet_id: sheet.id).state <= state
user.logs.update({ 'sheet_id' => sheet.id, 'state' => state }, nil, nil)
score = user.scores.find_by(sheet_id: sheet.id)
next if score.state <= state
score.update_with_logs({ 'sheet_id' => sheet.id, 'state' => state }, nil, nil)
end
true
end
Expand Down

0 comments on commit d3629f0

Please sign in to comment.