mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 16:30:59 +00:00
Purged git history and removed sensitive information.
This commit is contained in:
commit
6bcc8dc76b
862 changed files with 25312 additions and 0 deletions
42
app/controllers/log_files_controller.rb
Normal file
42
app/controllers/log_files_controller.rb
Normal file
|
@ -0,0 +1,42 @@
|
|||
class LogFilesController < ApplicationController
|
||||
def index
|
||||
LogFile.process
|
||||
render :text => "Ok"
|
||||
end
|
||||
|
||||
def handle
|
||||
LogFile.find(params[:id]).deal
|
||||
render :text => "Ok"
|
||||
end
|
||||
|
||||
def refresh
|
||||
LogFile.unhandled.each do |lf|
|
||||
lf.deal
|
||||
end
|
||||
end
|
||||
|
||||
def fix
|
||||
Rounder.find_in_batches(:batch_size => 100) do |rounders|
|
||||
rounders.each do |r|
|
||||
r.team_id = nil
|
||||
if r.user and t = Teamer.historic(r.user, r.round.start).first
|
||||
r.team_id = t.team_id
|
||||
end
|
||||
r.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def pix
|
||||
Round.all.each do |r|
|
||||
r.team1_id = nil
|
||||
r.team2_id = nil
|
||||
[1, 2].each do |team|
|
||||
if s = r.rounders.team(team).stats.first
|
||||
r["team#{team}_id"] = s["team_id"]
|
||||
end
|
||||
end
|
||||
r.save
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue