mirror of
https://github.com/internetee/registry.git
synced 2025-07-28 05:26:17 +02:00
Fixed phantom domain statuses
This commit is contained in:
parent
1961b87f95
commit
fc99ada943
2 changed files with 45 additions and 22 deletions
|
@ -58,10 +58,11 @@ module Serializers
|
|||
}
|
||||
end
|
||||
|
||||
def statuses
|
||||
statuses_with_notes = domain.status_notes
|
||||
def statuses(statuses_with_notes = {})
|
||||
status_notes = domain.status_notes
|
||||
domain.statuses.each do |status|
|
||||
statuses_with_notes.merge!({ "#{status}": '' }) unless statuses_with_notes.key?(status)
|
||||
status_note = status_notes[status.to_s].presence || ''
|
||||
statuses_with_notes.merge!({ "#{status}": status_note })
|
||||
end
|
||||
statuses_with_notes
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue