From 07ed51d90b17305f28f32eb928d4344aadc1f127 Mon Sep 17 00:00:00 2001 From: Abdul Rafay Modi <74718326+AlphaRomeoMike@users.noreply.github.com> Date: Tue, 18 Oct 2022 13:52:50 +0500 Subject: [PATCH 1/2] Update editor_controller.rb Removed 'and', replaced the logic with double ampersand This PR closes #11502 --- app/controllers/editor_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/editor_controller.rb b/app/controllers/editor_controller.rb index ac38e47b72..b7e96c5135 100644 --- a/app/controllers/editor_controller.rb +++ b/app/controllers/editor_controller.rb @@ -35,12 +35,12 @@ def rich @main_image = Image.find_by(id: params[:main_image]).path end - if params[:tags]&.include? "lat:" and params[:tags]&.include? "lon:" + if params[:tags]&.include? "lat:" && params[:tags]&.include? "lon:" tags = params[:tags].split(',') tags.each do |x| - x.include? "lat:" and (@lat = x.split(':')[1]) - x.include? "lon:" and (@lon = x.split(':')[1]) - x.include? "zoom:" and (@zoom = x.split(':')[1]) + x.include? "lat:" && (@lat = x.split(':')[1]) + x.include? "lon:" && (@lon = x.split(':')[1]) + x.include? "zoom:" && (@zoom = x.split(':')[1]) end end From 6b0efce5c6af7a6f2d71b316cdac22712aa60200 Mon Sep 17 00:00:00 2001 From: Abdul Rafay Modi <74718326+AlphaRomeoMike@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:07:24 +0500 Subject: [PATCH 2/2] Update app/controllers/editor_controller.rb Co-authored-by: Tilda Udufo --- app/controllers/editor_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/editor_controller.rb b/app/controllers/editor_controller.rb index b7e96c5135..b7833362bd 100644 --- a/app/controllers/editor_controller.rb +++ b/app/controllers/editor_controller.rb @@ -35,7 +35,7 @@ def rich @main_image = Image.find_by(id: params[:main_image]).path end - if params[:tags]&.include? "lat:" && params[:tags]&.include? "lon:" + if params[:tags]&.include?('lat:') && params[:tags]&.include?('lon:') tags = params[:tags].split(',') tags.each do |x| x.include? "lat:" && (@lat = x.split(':')[1])