Skip to content

Add Prefecture.where to return all prefix matches - #90

Merged
chocoby merged 3 commits into
mainfrom
add-where-api
Aug 1, 2026
Merged

Add Prefecture.where to return all prefix matches#90
chocoby merged 3 commits into
mainfrom
add-where-api

Conversation

@chocoby

@chocoby chocoby commented Aug 1, 2026

Copy link
Copy Markdown
Owner

背景

  • find(name: '山') は複数の都道府県に一致しても最初の 1 件しか返さず、他の一致を取得する手段がなかった

変更点

  • JpPrefecture::Prefecture.where を追加し、一致したすべての都道府県を配列で返す
  • 対応項目は name / name_e / name_r / name_h / name_k のみ、それ以外は ArgumentError
  • 前方一致・大文字小文字を区別しない点は find と同じ
  • Finder::NAME_FIELDS を定数として切り出し、findwhere で共有

影響

  • find の挙動は変更なし

@coveralls

coveralls commented Aug 1, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same — add-where-api into main

@chocoby
chocoby marked this pull request as ready for review August 1, 2026 10:32
@chocoby
chocoby merged commit 0067294 into main Aug 1, 2026
51 checks passed
@chocoby
chocoby deleted the add-where-api branch August 1, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants