Skip to content

Commit c2560d7

Browse files
committed
Lint: Remove parentheses for render action in controllers
1 parent 8aad213 commit c2560d7

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

app/controllers/admin/dashboard_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def show
1212
authorize(self)
1313
respond_to do |format|
1414
format.html
15-
format.json { render(json: dashboard_data) }
15+
format.json { render json: dashboard_data }
1616
end
1717
end
1818
end

app/controllers/code_ocean/files_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def create_and_respond(options = {})
6969
flash[:danger] = t('code_ocean/files.error.filename', name: filename)
7070
redirect_to options[:path], status: :see_other
7171
end
72-
format.json { render(json: @object.errors, status: :unprocessable_content) }
72+
format.json { render json: @object.errors, status: :unprocessable_content }
7373
end
7474
end
7575
end

app/controllers/concerns/common_behavior.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ def destroy_and_respond(options = {})
3131
private :destroy_and_respond
3232

3333
def respond_with_invalid_object(format, options = {})
34-
format.html { render(options[:template], status: :unprocessable_content) }
35-
format.json { render(json: @object.errors, status: :unprocessable_content) }
34+
format.html { render options[:template], status: :unprocessable_content }
35+
format.json { render json: @object.errors, status: :unprocessable_content }
3636
end
3737

3838
def respond_with_valid_object(format, options = {})
3939
format.html { redirect_to options[:path], notice: options[:notice], status: :see_other }
40-
format.json { render(:show, location: @object, status: options[:status]) }
40+
format.json { render :show, location: @object, status: options[:status] }
4141
end
4242
private :respond_with_valid_object
4343

app/controllers/concerns/redirect_behavior.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def redirect_to_community_solution
2828
url = edit_community_solution_path(@community_solution, lock_id: @community_solution_lock.id)
2929
respond_to do |format|
3030
format.html { redirect_to url, status: :see_other }
31-
format.json { render(json: {redirect: url}) }
31+
format.json { render json: {redirect: url} }
3232
end
3333
end
3434

@@ -68,7 +68,7 @@ def redirect_to_user_feedback
6868

6969
respond_to do |format|
7070
format.html { redirect_to url, status: :see_other }
71-
format.json { render(json: {redirect: url}) }
71+
format.json { render json: {redirect: url} }
7272
end
7373
end
7474

@@ -82,7 +82,7 @@ def redirect_to_unsolved_rfc(own: false)
8282

8383
respond_to do |format|
8484
format.html { redirect_to @rfc, status: :see_other }
85-
format.json { render(json: {redirect: url_for(@rfc)}) }
85+
format.json { render json: {redirect: url_for(@rfc)} }
8686
end
8787
end
8888

@@ -112,7 +112,7 @@ def redirect_to_lti_return_path
112112
path = lti_return_path(submission_id: @submission.id)
113113
respond_to do |format|
114114
format.html { redirect_to path, status: :see_other }
115-
format.json { render(json: {redirect: path}) }
115+
format.json { render json: {redirect: path} }
116116
end
117117
end
118118
end

app/controllers/exercises_controller.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def batch_update
5252
@exercises.each do |exercise|
5353
exercise.update(public: update_map[exercise.id.to_s])
5454
end
55-
render(json: {exercises: @exercises})
55+
render json: {exercises: @exercises}
5656
end
5757

5858
def clone
@@ -451,21 +451,21 @@ def set_available_tips
451451
def working_times
452452
working_time_accumulated = @exercise.accumulated_working_time_for_only(current_contributor)
453453
working_time_75_percentile = @exercise.get_quantiles([0.75]).first
454-
render(json: {working_time_75_percentile:,
455-
working_time_accumulated:})
454+
render json: {working_time_75_percentile:,
455+
working_time_accumulated:}
456456
end
457457

458458
def intervention
459459
intervention = Intervention.find_by(name: params[:intervention_type])
460460
if intervention.nil?
461-
render(json: {success: 'false', error: "undefined intervention #{params[:intervention_type]}"})
461+
render json: {success: 'false', error: "undefined intervention #{params[:intervention_type]}"}
462462
else
463463
uei = UserExerciseIntervention.new(
464464
user: current_contributor, exercise: @exercise, intervention:,
465465
accumulated_worktime_s: @exercise.accumulated_working_time_for_only(current_contributor)
466466
)
467467
uei.save
468-
render(json: {success: 'true'})
468+
render json: {success: 'true'}
469469
end
470470
end
471471

app/controllers/external_users_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def tag_statistics
102102
statistics.sort_by! {|item| -item[:value] }
103103

104104
respond_to do |format|
105-
format.json { render(json: statistics) }
105+
format.json { render json: statistics }
106106
end
107107
end
108108
end

app/controllers/statistics_controller.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,34 @@ def policy_class
1313
def show
1414
respond_to do |format|
1515
format.html
16-
format.json { render(json: statistics_data) }
16+
format.json { render json: statistics_data }
1717
end
1818
end
1919

2020
def graphs; end
2121

2222
def user_activity
2323
respond_to do |format|
24-
format.json { render(json: user_activity_live_data) }
24+
format.json { render json: user_activity_live_data }
2525
end
2626
end
2727

2828
def user_activity_history
2929
respond_to do |format|
30-
format.html { render('activity_history', locals: {resource: :user}) }
30+
format.html { render 'activity_history', locals: {resource: :user} }
3131
format.json { render_ranged_data :ranged_user_data }
3232
end
3333
end
3434

3535
def rfc_activity
3636
respond_to do |format|
37-
format.json { render(json: rfc_activity_data) }
37+
format.json { render json: rfc_activity_data }
3838
end
3939
end
4040

4141
def rfc_activity_history
4242
respond_to do |format|
43-
format.html { render('activity_history', locals: {resource: :rfc}) }
43+
format.html { render 'activity_history', locals: {resource: :rfc} }
4444
format.json { render_ranged_data :ranged_rfc_data }
4545
end
4646
end
@@ -57,7 +57,7 @@ def render_ranged_data(data_source)
5757
rescue StandardError
5858
DateTime.now
5959
end
60-
render(json: send(data_source, interval, from, to))
60+
render json: send(data_source, interval, from, to)
6161
end
6262

6363
def authorize!

0 commit comments

Comments
 (0)