Skip to content

Commit

Permalink
Fix: Fix rubocop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sevenc-nanashi committed Sep 29, 2024
1 parent d9eb784 commit 2519da7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 4 additions & 4 deletions backend/app/controllers/sonolus/levels_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def show
Like.find_by(user_id: current_user.id, chart_id: chart.id)

render json: {
item: chart.to_sonolus(background_version: ),
item: chart.to_sonolus(background_version:),
hasCommunity: false,
actions: [
(
Expand Down Expand Up @@ -449,9 +449,9 @@ def show
title: I18n.t("sonolus.levels.sections.variants"),
itemType: "level",
items:
chart.variants.map {
_1.to_sonolus(background_version:)
}
chart.variants.map do |level|
level.to_sonolus(background_version:)
end
},
{
title: I18n.t("sonolus.levels.sections.backgrounds"),
Expand Down
7 changes: 2 additions & 5 deletions backend/app/controllers/sonolus_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ class SonolusController < ApplicationController
before_action do
params.permit(:c_background)
background_version = params[:c_background]
if background_version
self.background_version = [1, 3][background_version.to_i]
else
self.background_version = 3
end
self.background_version =
(background_version ? [1, 3][background_version.to_i] : 3)
end

around_action do |_, action|
Expand Down

0 comments on commit 2519da7

Please sign in to comment.