Open
Conversation
c2b24c1 to
f1fbf63
Compare
Codecov Report
@@ Coverage Diff @@
## development #110 +/- ##
===============================================
+ Coverage 97.59% 97.68% +0.09%
===============================================
Files 33 34 +1
Lines 415 432 +17
===============================================
+ Hits 405 422 +17
Misses 10 10
Continue to review full report at Codecov.
|
euglena1215
reviewed
May 2, 2019
| class Api::V1::ChatsController < ApplicationController | ||
| def index | ||
| room = Room.find_by(key: params[:room_key]) | ||
| if room.blank? |
Collaborator
There was a problem hiding this comment.
FYI
こんな感じで毎回チェックするの面倒なので
ApiCommonにこんなの追加して
module ApiCommon
included do
rescue_from ActiveRecord::RecordNotFound do |_e|
render json: { error: t("404 error") }, status: 404
end
end
endclass Api::V1::ChatsController < ApplicationController
def index
room = Room.find(key: params[:room_key])
...
end
endって書けた方が冗長な箇所がなくなって綺麗になると思う
euglena1215
reviewed
May 2, 2019
| return | ||
| end | ||
|
|
||
| if params[:cursor].present? |
Collaborator
There was a problem hiding this comment.
このifのチェックいらない気がする?
下のChat.find_byでnilが返るだけなので
https://github.com/cyder/SyncPod-server/pull/110/files#diff-95f5b6164012ab93315ecba597608414R17 は意味を為してない気がします
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
/api/v1/chatsにroom_keyと前回取得した最後のchat id(cursor)を指定することで、それより前の(cursor自体は含まない)過去チャットが取得できる。cursorを指定しないときは最新のチャットを取得する
検討事項