-
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.
* feat: 🎸 Gss::Character を追加した * style: 💄 RuboCop の指摘に従い修正した * fix: 🐛 Fix a spec
- Loading branch information
1 parent
8f18ff5
commit e7f52c3
Showing
19 changed files
with
289 additions
and
252 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Gss | ||
def self.table_name_prefix | ||
'gss_' | ||
end | ||
end |
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,4 @@ | ||
module Gss | ||
class Character < ApplicationRecord | ||
end | ||
end |
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 |
---|---|---|
@@ -1,14 +1,5 @@ | ||
module ImportService | ||
class Character < Base | ||
def rows | ||
on_sheet_gss_characters = ::OnSheet::GssCharacter.all | ||
|
||
# TODO: 「極」からのデータソースを作り、幻水総選挙は別名前空間へ移す | ||
names = on_sheet_gss_characters.map(&:name) | ||
# TODO: 名前のデータソースを作る | ||
name_ens = on_sheet_gss_characters.count.times.map { |_| '' } | ||
|
||
names.zip(name_ens) | ||
end | ||
def rows; end | ||
end | ||
end |
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,24 @@ | ||
module ImportService | ||
module Gss | ||
class Character | ||
def execute | ||
on_sheet_gss_characters = ::OnSheet::GssCharacter.all | ||
names = on_sheet_gss_characters.map(&:name) | ||
sosenkyo_names = on_sheet_gss_characters.map(&:sosenkyo_name) | ||
|
||
gss_characters = [] | ||
|
||
names.zip(sosenkyo_names).each do |name, sosenkyo_name| | ||
next if sosenkyo_name.blank? | ||
|
||
gss_characters << ::Gss::Character.new( | ||
name:, | ||
sosenkyo_name: | ||
) | ||
end | ||
|
||
::Gss::Character.import!(gss_characters) | ||
end | ||
end | ||
end | ||
end |
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.