ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'capture_ids' in 'field list'
Validation: a59d1eba-2e86-4485-82d3-67a37c60a4b2
Verdict: APPROVED#
Completeness#
| Plan Item | Status | Evidence |
|---|---|---|
1. _ancestor_name (runtime path)에 pick(:name) 앞 name 컬럼 존재 가드 추가, 없으면 쿼리 없이 nil 반환 |
PASS | app/models/concerns/entity_indexable.rb: line 173 return nil unless klass.column_names.include?('name') 이 line 172(return nil unless klass)와 line 175(klass.where(id: ancestor_id).pick(:name)) 사이에 삽입됨. 가드 실패 시 pick 미실행 후 nil 반환. |
2. batch path (lib/cupix/migrate/entity.rb의 AncestorCache#preload)에 pluck(:id, :name) 앞 동일 가드 추가, 컬럼 없는 클래스 preload skip |
PASS | lib/cupix/migrate/entity.rb: line 120 next unless klass.column_names.include?('name') 이 line 119(next unless klass)와 line 122(ids = collect_ids...)/line 125(pluck(:id, :name)) 앞에 삽입됨. 조건 미충족 시 next로 해당 클래스 preload skip. |
Acceptance Criteria#
| Criterion | Status | Evidence |
|---|---|---|
_ancestor_name guards pick(:name) with a name column existence check |
PASS | app/models/concerns/entity_indexable.rb: line 173 가드가 line 175 pick(:name) 직전에 위치. |
AncestorCache#preload loop guards pluck(:id, :name) with the same check |
PASS | lib/cupix/migrate/entity.rb: line 120 가드가 CACHE_ANCESTOR_FIELDS.each 루프 내(line 117 시작) line 125 pluck(:id, :name) 직전에 위치. 두 파일 모두 동일 문자열 klass.column_names.include?('name') 사용. |
Record (records table, no name column) issues NO name lookup SQL in either path |
PASS | 양 경로 모두 CACHE_ANCESTOR_FIELDS(entity_indexable.rb:23-32, record: :record_id 포함) 순회. Record는 name 컬럼 부재이므로 line 173/120 가드에서 각각 return nil/next → pick/pluck 미실행. |
| team/workspace/building/capture/level/bim/annotation_layer (name column present) still look up name | PASS | 가드는 name 컬럼이 존재하는 클래스에는 통과 → 기존 pick/pluck 로직 그대로 실행. 해당 7종은 CACHE_ANCESTOR_FIELDS(entity_indexable.rb:24-31)에 포함되며 record만 제외됨. name 컬럼 유무는 diff로 확인 불가하나(runtime check), 가드가 컬럼 유무에 따라 정확히 분기하므로 name 보유 클래스는 영향 없음. |
ruby -c passes; bundle exec rubocop 0 offenses on changed files |
UNVERIFIED | Diff로 검증 불가 -- runtime check 필요. 삽입된 두 줄은 문법적으로 정상(기존 return nil unless/next unless 패턴 그대로 답습, column_names.include? 표준 API). 명백한 syntax 오류 없음. |
Issues Found#
No blocking issues found.
Observations#
- 두 파일의 가드가 동일한 표현식(
klass.column_names.include?('name'))을 사용해 일관성이 좋음. - 두 경로 모두 기존의
rescue StandardError방어망을 유지하므로, 가드가 놓치는 엣지 케이스가 있어도 기존 동작 대비 회귀 위험 없음. column_names는 첫 호출 시 스키마 조회를 트리거할 수 있으나 ActiveRecord가 클래스 단위로 캐시하므로 반복 reindex에서 추가 SQL 부담 무시 가능.- Plan 범위를 벗어난 불필요한 코드 추가 없음(각 파일 정확히 1줄 추가).
ruby -c/ rubocop 결과는 diff만으로 확정 불가하나 삽입 라인이 기존 스타일과 완전히 일치하여 offense 유발 가능성 낮음.