Skip to content

Fix regression on /names/user returning empty list#304

Merged
lmrodriguezr merged 2 commits into
mainfrom
names-regression
Jun 30, 2026
Merged

Fix regression on /names/user returning empty list#304
lmrodriguezr merged 2 commits into
mainfrom
names-regression

Conversation

@vangberg

Copy link
Copy Markdown
Contributor

Fixes #303

NamesController#user sets params[:status] = 'all'. Before pull request #288 this was converted into opts[:status] = nil:

    opts[:status] ||=
      case @status.to_s.downcase
      when 'public';    Name.public_status
      when 'automated'; 0
      when 'seqcode';   15
      when 'icnp';      20
      when 'icnafp';    25
      when 'valid';     Name.valid_status
      end

The pull request changed that code to call map_status_to_value, which returns 'all'. This in turn would be sent to apply_name_filters which would create the condition WHERE status = 'all', returning nothing. By explicitly returning nil instead, no conditions on status are imposed.

`NamesController#user` sets `params[:status] = 'all'`. Before pull request #288
this was converted into `opts[:status] = nil`:

```ruby
    opts[:status] ||=
      case @status.to_s.downcase
      when 'public';    Name.public_status
      when 'automated'; 0
      when 'seqcode';   15
      when 'icnp';      20
      when 'icnafp';    25
      when 'valid';     Name.valid_status
      end
```

The pull request changed that code to call `map_status_to_value`, which returns
`'all'`. This in turn would be sent to `apply_name_filters` which would create
the condition `WHERE status = 'all'`, returning nothing. By explicitly returning
`nil` instead, no conditions on `status` are imposed.
@vangberg vangberg requested a review from lmrodriguezr June 30, 2026 10:45
@lmrodriguezr lmrodriguezr merged commit e2f876c into main Jun 30, 2026
4 checks passed
@lmrodriguezr lmrodriguezr deleted the names-regression branch June 30, 2026 17:23
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.

"My names" should show all names, including drafts

2 participants