Skip to content

Commit

Permalink
if文の返り値を代入する部分のインデントを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
ham-cap committed Nov 6, 2024
1 parent 74b97b4 commit f1f6a1f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/controllers/users/courses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ class Users::CoursesController < ApplicationController

def index
@target = ALLOWED_TARGETS.include?(params[:target]) ? params[:target] : ALLOWED_TARGETS.first
course_names = if @target == 'other_courses'
Course.where(published: false).pluck(:title)
else
Course.where(published: true).where(title: I18n.t("course_names.#{@target}")).pluck(:title)
end
course_names =
if @target == 'other_courses'
Course.where(published: false).pluck(:title)
else
Course.where(published: true).where(title: I18n.t("course_names.#{@target}")).pluck(:title)
end

target_users = User.by_course(course_names).students_and_trainees
@users = target_users
Expand Down

0 comments on commit f1f6a1f

Please sign in to comment.