Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.6.1 #112

Merged
merged 4 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ vendor/
.vscode/
.history/
.env
node_modules
.clasp.json
.clasprc.json

/.bundle

Expand Down
9 changes: 8 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ GEM
google-cloud-language-v1beta2 (0.4.5)
gapic-common (>= 0.7, < 2.a)
google-cloud-errors (~> 1.0)
google-protobuf (3.21.1)
google-protobuf (3.21.1-x86_64-linux)
googleapis-common-protos (1.3.12)
google-protobuf (~> 3.14)
Expand All @@ -183,6 +184,9 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grpc (1.46.3)
google-protobuf (~> 3.19)
googleapis-common-protos-types (~> 1.0)
grpc (1.46.3-x86_64-linux)
google-protobuf (~> 3.19)
googleapis-common-protos-types (~> 1.0)
Expand Down Expand Up @@ -238,6 +242,8 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.6-aarch64-linux)
racc (~> 1.4)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
os (1.1.4)
Expand Down Expand Up @@ -366,6 +372,7 @@ GEM
zeitwerk (2.5.4)

PLATFORMS
aarch64-linux
x86_64-linux

DEPENDENCIES
Expand All @@ -391,4 +398,4 @@ RUBY VERSION
ruby 3.1.2p20

BUNDLED WITH
2.3.14
2.3.16
8 changes: 5 additions & 3 deletions app/services/sheets/result_illustration_applications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def self.get
)
end

# 「生ログ」なので、急いで必要になることはない
def self.import_statuses_data_to_database
rows = SheetData.get_rows(
sheet_id: ENV.fetch('RESULTS_ILLUSTRATIONS_APPLICATION_STATUS_SHEET_ID'),
Expand Down Expand Up @@ -55,10 +56,8 @@ def self.import_statuses_data_to_database
end
end

# API のレスポンスの元となるデータ
def self.import_totallings_data_to_database
# ここ主キーがないから問答無用で全削除開始でもいいかもしれない
OnRawSheetResultIllustrationTotalling.destroy_all

rows = SheetData.get_rows(
sheet_id: ENV.fetch('RESULTS_ILLUSTRATIONS_APPLICATION_STATUS_SHEET_ID'),
range: "開票イラスト!A1:P"
Expand Down Expand Up @@ -90,6 +89,9 @@ def self.import_totallings_data_to_database

# TODO: バルクインサートする
ActiveRecord::Base.transaction do
# 主キーがないから問答無用で全削除して入れ直す
OnRawSheetResultIllustrationTotalling.destroy_all

rows.each_with_index do |row, i|
# TODO: このスキップ条件は切り出せそう
next if i == 0 || row[cloumn_names_and_sheet_index_number['character_name_for_sheet_totalling']].blank? || row[cloumn_names_and_sheet_index_number['character_name_for_public']].blank?
Expand Down