ES /docs

Error occurred during comparing location longitude.

Fix Plan: Error occurred during comparing location longitude

Changes#

tesla: app/models/concerns/geo_queriable.rb#

  • What: _location_field_changed? 메서드(66-75줄)에서 beforeafter 값을 읽은 후 .to_f 변환을 추가합니다. saved_changes['sys']에서 가져온 값이 String일 수 있으므로, 산술 연산(-) 전에 안전하게 Float로 변환합니다.
  • Why: JSONB 컬럼에 String 형태로 저장된 longitude/latitude 값이 saved_changes를 통해 raw로 읽힐 때 NoMethodError: undefined method '-' for an instance of String 에러가 발생합니다. to_f를 적용하면 String → Float 변환이 안전하게 수행됩니다.
  • Lines: 68-69

Acceptance Criteria#

  • geo_queriable.rb 68줄: before 값에 .to_f가 적용됨
  • geo_queriable.rb 69줄: after 값에 .to_f가 적용됨
  • 변경이 2줄(68-69)에만 국한되며 다른 코드는 수정하지 않음

Tests#

  • 기존 테스트: spec/models/concerns/geo_queriable_spec.rblocation_changed? 관련 테스트가 모두 통과해야 함
  • 신규 테스트: 없음 (기존 테스트로 충분)