Skip to content
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
2 changes: 1 addition & 1 deletion backend/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ GEM
lint_roller (~> 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-rails (2.34.3)
rubocop-rails (2.36.0)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
Expand Down
4 changes: 2 additions & 2 deletions backend/app/controllers/api/v1/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def destroy
private

def set_discussion
@discussion = Discussion.find(params[:discussion_id])
@discussion = Discussion.find(params.expect(:discussion_id))
end

def set_comment
@comment = Comment.find(params[:id])
@comment = Comment.find(params.expect(:id))
end

def authorize_record_owner_for_comment!
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/v1/discussions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def discussion_params
end

def set_discussion
@discussion = Discussion.includes(:user, work: :images).find(params[:id])
@discussion = Discussion.includes(:user, work: :images).find(params.expect(:id))
end

def discussion_list_json(discussion)
Expand Down
4 changes: 2 additions & 2 deletions backend/app/controllers/api/v1/episode_reviews_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def destroy
private

def set_record
@record = Record.find(params[:record_id])
@record = Record.find(params.expect(:record_id))
end

def authorize_record!
Expand All @@ -49,7 +49,7 @@ def authorize_record!
end

def set_episode_review
@episode_review = @record.episode_reviews.find(params[:id])
@episode_review = @record.episode_reviews.find(params.expect(:id))
end

def episode_review_params
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module V1
class FavoriteWorksController < ApplicationController
# GET /api/v1/users/:user_id/favorite_works(認証不要)
def index
user = User.find(params[:user_id])
user = User.find(params.expect(:user_id))
favorite_works = user.favorite_works.includes(:work).order(:position)

render json: {
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/v1/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def create
# DELETE /api/v1/images/:id
# DBレコードとS3ファイルの両方を削除する
def destroy
image = Image.find(params[:id])
image = Image.find(params.expect(:id))
return unless authorize_image!(image)

s3_key = image.s3_key
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/v1/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Api::V1::ProfilesController < ApplicationController

# GET /api/v1/users/:id
def show
user = User.find(params[:id])
user = User.find(params.expect(:id))
records = user.records.includes(:work)

render json: {
Expand Down
4 changes: 2 additions & 2 deletions backend/app/controllers/api/v1/record_tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def create

# DELETE /api/v1/records/:record_id/tags/:id
def destroy
record_tag = @record.record_tags.find_by!(tag_id: params[:id])
record_tag = @record.record_tags.find_by!(tag_id: params.expect(:id))
record_tag.destroy!
head :no_content
end

private

def set_record
@record = Record.find(params[:record_id])
@record = Record.find(params.expect(:record_id))
end

def authorize_record!
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/v1/records_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def pagination_meta(page, per_page, total_count)
end

def set_record
@record = Record.includes(work: :images, tags: []).find(params[:id])
@record = Record.includes(work: :images, tags: []).find(params.expect(:id))
end

def authorize_record!
Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/v1/user_records_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Api::V1::UserRecordsController < ApplicationController

# GET /api/v1/users/:user_id/records
def index
user = User.find(params[:user_id])
user = User.find(params.expect(:user_id))
records = build_query(user)
paginated = paginate(records)

Expand Down
2 changes: 1 addition & 1 deletion backend/app/controllers/api/v1/works_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create
# POST /api/v1/works/:id/sync
# AniListからデータを再取得して更新する
def sync
work = Work.find(params[:id])
work = Work.find(params.expect(:id))
sync_service = AniListSyncService.new

sync_service.sync_work(work) if sync_service.needs_sync?(work)
Expand Down