Skip to content

Commit

Permalink
Added a Hacks.md file with a list of instructions for uncommon issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dbroeglin committed May 5, 2024
1 parent b6afa7a commit efc8e60
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/Hacks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Changing an already started taikai from 12 arrows to 20 arrows

/!\ Works for this commit: 2023-11-21 5dfaec7, _be careful if you try it on a more recent one_!

```ruby
taikai = Taikai.find(177)

taikai.update_attribute(:total_num_arrows, 20)
taikai.participating_dojos.first.participants.each do |participant|
now = DateTime.now
participant.score.results.insert_all(
(4..5).map do |round_index|
(1..4).map do |index|
{
match_id: nil,
score_id: participant.score.id,
round: round_index,
index: index,
created_at: now,
updated_at: now,
}
end
end.flatten)
end
```

# Reseting all users' passwords

/!\ This will reset ALL passwords!!!

```ruby
User.all.each { |u| u.update(encrypted_password: User.new.send(:password_digest, 'password')) }
```

0 comments on commit efc8e60

Please sign in to comment.