Cleanup Lint/AssignmentInCondition rubocop issues on code and remove it from ruboco_todo list
This commit is contained in:
@@ -37,8 +37,10 @@ class Legislation::AnnotationsController < ApplicationController
|
||||
range_start: annotation_params[:ranges].first[:start], range_start_offset: annotation_params[:ranges].first[:startOffset].to_i,
|
||||
range_end: annotation_params[:ranges].first[:end], range_end_offset: annotation_params[:ranges].first[:endOffset].to_i).first
|
||||
|
||||
if @annotation = existing_annotation
|
||||
if comment = @annotation.comments.create(body: annotation_params[:text], user: current_user)
|
||||
@annotation = existing_annotation
|
||||
if @annotation.present?
|
||||
comment = @annotation.comments.create(body: annotation_params[:text], user: current_user)
|
||||
if comment.present?
|
||||
render json: @annotation.to_json
|
||||
else
|
||||
render json: comment.errors.full_messages, status: :unprocessable_entity
|
||||
|
||||
Reference in New Issue
Block a user