-
Notifications
You must be signed in to change notification settings - Fork 7
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
チェックイン用のAPIエンドポイントを追加 #2300
チェックイン用のAPIエンドポイントを追加 #2300
Conversation
takaishi
commented
May 5, 2024
•
edited
Loading
edited
- イベントとセッションそれぞれにチェックイン用のエンドポイントを追加しました
- UI側の実装を楽にするため追記型にして、同じ参加者でも何回でもチェックインできるようにしています。
46430aa
to
7017af1
Compare
7017af1
to
324cf85
Compare
Simplecov Report
|
CIこけてるのなんだこれ |
app/models/conference.rb
Outdated
@@ -73,6 +73,8 @@ class Conference < ApplicationRecord | |||
has_many :admin_profiles | |||
has_many :media_package_harvest_jobs | |||
has_many :rooms | |||
has_many :check_in_conferences | |||
has_many :check_in_talks |
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.
check_in_talks は profile-talk 間の relation な気がします
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.
直しました!
create_table :check_in_conferences do |t| | ||
t.belongs_to :conference, null: false, foreign_key: true | ||
t.belongs_to :profile, null: false, foreign_key: true | ||
t.datetime :timestamp, null: false |
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.
この timestamp column は多分フロント側でチェックインした時間だと思うのですが、 timestamp
は SQL の予約語と被ってしまうので使用は避けた方がベターな気がします(絶対に避けるべきという強い意志ではないです)
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.
確かになと思ったのでリネームしました!
def create | ||
@params = check_in_conference_params(JSON.parse(request.body.read, { symbolize_names: true })) | ||
profile = Profile.find(@params[:profileId]) | ||
timestamp = Time.at(@params[:timestamp]) |
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.
rails では TimeWithZone が利用されるのでそちらに合わせてしまうのがよさそうかと
timestamp = Time.at(@params[:timestamp]) | |
timestamp = Time.zone.at(@params[:timestamp]) |
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.
👍
CI がこけてる件はこの commit で修正されていそうでした! |
commit: cloudnativedaysjp/dreamkast@d65f257 Co-authored-by: GitHub Action <[email protected]>
d65f257
to
39159a9
Compare
commit: cloudnativedaysjp/dreamkast@39159a9 Co-authored-by: GitHub Action <[email protected]>
commit: cloudnativedaysjp/dreamkast@d3cc328 Co-authored-by: GitHub Action <[email protected]>
commit: cloudnativedaysjp/dreamkast@1b9f7b4 Co-authored-by: GitHub Action <[email protected]>
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.
LGTM!