Skip to content

Commit

Permalink
feat: 🎸 Constant で Gss キャラ名を取得するクラスを更新した (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikukyugamer authored Jul 27, 2023
1 parent a54c7be commit f77dc0d
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 6 deletions.
4 changes: 2 additions & 2 deletions all_scripts_execution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euxo pipefail

scripts/csv_downloader.sh
scripts/db_construction.sh
scripts/exec_local_rspec.sh
scripts/import_csv_and_make_up_db.sh
scripts/exec_local_init_rspec.sh

exit 0
37 changes: 37 additions & 0 deletions app/lib/constant/gss_character_names.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@
module Constant
class GssCharacterNames
class << self
def s1
ProductTitle.find_by(name: '幻想水滸伝').gss_characters.pluck(:name)
end

def s2
ProductTitle.find_by(name: '幻想水滸伝II').gss_characters.pluck(:name)
end

def gaiden
ProductTitle.find_by(name: '幻想水滸外伝Vol.1').gss_characters.pluck(:name) &&
ProductTitle.find_by(name: '幻想水滸外伝Vol.2').gss_characters.pluck(:name)
end

def s3
ProductTitle.find_by(name: '幻想水滸伝III').gss_characters.pluck(:name)
end

def s4
ProductTitle.find_by(name: '幻想水滸伝IV').gss_characters.pluck(:name)
end

def rhapsodia
ProductTitle.find_by(name: 'Rhapsodia').gss_characters.pluck(:name)
end

def s5
ProductTitle.find_by(name: '幻想水滸伝V').gss_characters.pluck(:name)
end

def tk
ProductTitle.find_by(name: '幻想水滸伝ティアクライス').gss_characters.pluck(:name)
end

def tsumutoki
ProductTitle.find_by(name: '幻想水滸伝 紡がれし百年の時').gss_characters.pluck(:name)
end

def values
[
'からくり丸',
Expand Down
2 changes: 1 addition & 1 deletion db/erd.dot
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ m_Nickname [label = <<table border="0" align="center" cellspacing="0.5" cellpadd
</table>
|
<table border="0" align="left" cellspacing="2" cellpadding="0" width="134">
<tr><td align="left" width="130" port="category">category <font face="Arial Italic" color="grey60">string ∗</font></td></tr>
<tr><td align="left" width="130" port="category">category <font face="Arial Italic" color="grey60">integer ∗</font></td></tr>
<tr><td align="left" width="130" port="id">id <font face="Arial Italic" color="grey60">integer (8) PK</font></td></tr>
<tr><td align="left" width="130" port="name">name <font face="Arial Italic" color="grey60">string</font></td></tr>
<tr><td align="left" width="130" port="name_en">name_en <font face="Arial Italic" color="grey60">string</font></td></tr>
Expand Down
Binary file modified db/erd.pdf
Binary file not shown.
Binary file modified db/erd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
set -euo pipefail

bundle exec rails db:import_csv

echo
echo "cf. lib/tasks/reconstruction.rake"
bundle exec rails db:make_up_db

exit 0
37 changes: 37 additions & 0 deletions spec/lib/constant/gss_character_names_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,42 @@
it '#values で値が返ってくること' do
expect(Constant::GssCharacterNames.values.count).to be > 0
end

it '#s1 で値が返ってくること' do
expect(Constant::GssCharacterNames.s1.count).to be > 0
end

# s2, gaiden, s3 , s4, rhapsodia, s5, tk, tsumutoki で値が0個以上返ってくること
it '#s2 で値が返ってくること' do
expect(Constant::GssCharacterNames.s2.count).to be > 0
end

it '#gaiden で値が返ってくること' do
expect(Constant::GssCharacterNames.gaiden.count).to be > 0
end

it '#s3 で値が返ってくること' do
expect(Constant::GssCharacterNames.s3.count).to be > 0
end

it '#s4 で値が返ってくること' do
expect(Constant::GssCharacterNames.s4.count).to be > 0
end

it '#rhapsodia で値が返ってくること' do
expect(Constant::GssCharacterNames.rhapsodia.count).to be > 0
end

it '#s5 で値が返ってくること' do
expect(Constant::GssCharacterNames.s5.count).to be > 0
end

it '#tk で値が返ってくること' do
expect(Constant::GssCharacterNames.tk.count).to be > 0
end

it '#tsumutoki で値が返ってくること' do
expect(Constant::GssCharacterNames.tsumutoki.count).to be > 0
end
end
end

0 comments on commit f77dc0d

Please sign in to comment.