Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
🐞 Fix languages list bug (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephannv authored Oct 23, 2021
1 parent b6c48a5 commit 47d7c47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/actions/items/list_languages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ListLanguages < Actor
output :languages, type: Array

def call
self.languages = Item.pluck(:languages).flatten.uniq.sort
self.languages = Item.pluck(:languages).flatten.uniq.compact.sort
end
end
end
2 changes: 1 addition & 1 deletion spec/actions/items/list_languages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
before do
create(:item, languages: %w[b])
create(:item, languages: %w[c a d])
create(:item, languages: %w[b d])
create(:item, languages: ['b', 'd', nil])
end

it 'returns languages ordered by name' do
Expand Down

0 comments on commit 47d7c47

Please sign in to comment.