-
Notifications
You must be signed in to change notification settings - Fork 45
電気料金比較APIの作成 #29
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
Open
MasafumiKondo07
wants to merge
19
commits into
enechange:master
Choose a base branch
from
MasafumiKondo07:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
電気料金比較APIの作成 #29
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
68fd066
新規Railsアプリの作成
MasafumiKondo07 ae5de6d
model、migrationファイルの追加
MasafumiKondo07 2eddab0
マスターデータ用のCSVの作成と、seedファイルの記述
MasafumiKondo07 82630c7
プランごとの電気料金を返すAPIの作成
MasafumiKondo07 45a0e14
重量料金計算ロジックを重量料金を扱うモデルへ移動
MasafumiKondo07 9b7a2c7
nil判定を後置ifから「 ||=」に変更
MasafumiKondo07 ac8e8e6
従量料金の計算方法の修正
MasafumiKondo07 152a767
電気料金算出ロジックをPlanモデルに寄せる
MasafumiKondo07 6d4fa21
従量料金を求めるロジックの修正
MasafumiKondo07 096506e
アプリの中で、「会社」の命名に一貫性を持たせるための修正
MasafumiKondo07 ca23a42
不要な項目を削除(CSV)
MasafumiKondo07 b550e4c
クラスメソッドの修正
MasafumiKondo07 6290631
rspec、factory_botの導入
MasafumiKondo07 21ff83c
ElectricityFeeモデルのクラスメソッドテスト用factoryの作成
MasafumiKondo07 2172b6e
従量料金計算クラスメソッドのテスト作成
MasafumiKondo07 14d1c7f
n + 1の解消
MasafumiKondo07 c92c96a
ファイル名が不適切だったため修正
MasafumiKondo07 3d03e55
基本料金のfactory作成
MasafumiKondo07 d87fc4d
controllerのテスト追加
MasafumiKondo07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここのロジックが一番複雑になるので、テストをしっかり書いてほしいです。期待値がなんであるか、その通りに出力されているか、テストに書いてあることでレビュワーは実際に動かさなくても結果が見えてきやすいので業務を効率よく行うためにテストは不可欠です。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
electricity_fee_instance.calcで呼び出していると思うのですが、そのelectricity_fee_instanceって既にplanから呼び出しているものなのに、ここでまたplan_idから引っ張ってくるのって二度手間ではないですか?
find_byとwhereで似たようなことを2回してしまっていると思いました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
再度ご確認いただきましてありがとうございます🙏
従量料金を求めるロジックを下記のように修正させていただきました。
6d4fa21
b550e4c
またテストが書けていなかったことについて、申し訳ございませんでした。
従量料金計算テストと、controllerのテストを追加させていただきました。
2172b6e
d87fc4d