Skip to content

Commit 8fb0f4d

Browse files
committed
Use flat_map instead of map and flatten
1 parent 78435d7 commit 8fb0f4d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/jsonapi/exceptions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ def format_key(key)
307307
end
308308

309309
def errors
310-
error_messages.map do |attr_key, messages|
310+
error_messages.flat_map do |attr_key, messages|
311311
messages.map { |message| json_api_error(attr_key, message) }
312-
end.flatten
312+
end
313313
end
314314

315315
private

0 commit comments

Comments
 (0)