-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update games serializer and add slug validation with default generati…
…on (#575) * lint * Update games serializer and add slug validation with default generation * Fix slug generation to handle nil names in game model * bundler updoot * lint * fix test * unregisters
- Loading branch information
1 parent
4e647df
commit 9d367ac
Showing
16 changed files
with
115 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ words: | |
- deepcode | ||
- logpanel | ||
- jacoco | ||
- unregisters | ||
- sqltools | ||
- sonarlint | ||
ignoreWords: [] | ||
|
44 changes: 44 additions & 0 deletions
44
db/migrate/20241209035641_insert_values_into_games_and_format.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
class InsertValuesIntoGamesAndFormat < ActiveRecord::Migration[7.2] | ||
def change | ||
add_column :games, :slug, :string, null: false | ||
add_index :games, :slug, unique: true | ||
|
||
sv = Game.create(name: "Scarlet & Violet", slug: "sv") | ||
swsh = Game.create(name: "Sword & Shield", slug: "swsh") | ||
lgpe = Game.create(name: "Let's Go Pikachu & Eevee", slug: "lgpe") | ||
bdsp = Game.create(name: "Brilliand Diamond & Shining Pearl", slug: "bdsp") | ||
pogo = Game.create(name: "Pokemon Go", slug: "pogo") | ||
|
||
Format.create(name: "Regulation A", game: sv) | ||
Format.create(name: "Regulation B", game: sv) | ||
Format.create(name: "Regulation C", game: sv) | ||
Format.create(name: "Regulation D", game: sv) | ||
Format.create(name: "Regulation E", game: sv) | ||
Format.create(name: "Regulation F", game: sv) | ||
Format.create(name: "Regulation G", game: sv) | ||
Format.create(name: "Regulation H", game: sv) | ||
Format.create(name: "Regulation I", game: sv) | ||
Format.create(name: "Regulation J", game: sv) | ||
|
||
Format.create(name: "Series 1", game: swsh) | ||
Format.create(name: "Series 2", game: swsh) | ||
Format.create(name: "Series 3", game: swsh) | ||
Format.create(name: "Series 4", game: swsh) | ||
Format.create(name: "Series 5", game: swsh) | ||
Format.create(name: "Series 6", game: swsh) | ||
Format.create(name: "Series 7", game: swsh) | ||
Format.create(name: "Series 8", game: swsh) | ||
Format.create(name: "Series 9", game: swsh) | ||
Format.create(name: "Series 10", game: swsh) | ||
Format.create(name: "Series 11", game: swsh) | ||
Format.create(name: "Series 12", game: swsh) | ||
Format.create(name: "Series 13", game: swsh) | ||
|
||
Format.create(name: "National Dex", game: lgpe) | ||
Format.create(name: "National Dex", game: bdsp) | ||
|
||
Format.create(name: "Great League", game: pogo) | ||
Format.create(name: "Ultra League", game: pogo) | ||
Format.create(name: "Master League", game: pogo) | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.