Fixed phantom domain statuses

This commit is contained in:
Sergei Tsoganov 2022-11-10 17:17:57 +02:00
parent 1961b87f95
commit fc99ada943
2 changed files with 45 additions and 22 deletions

View file

@ -55,11 +55,11 @@ GIT
GIT GIT
remote: https://github.com/internetee/omniauth-tara.git remote: https://github.com/internetee/omniauth-tara.git
revision: cec845ec3794532144c4976104a07e206d759aa6 revision: 215f5e91b8c1a51b2fe9a72755585096252a2f93
specs: specs:
omniauth-tara (0.3.0) omniauth-tara (0.4.0)
addressable (~> 2.5) addressable (~> 2.5)
omniauth (~> 1.3) omniauth (>= 1.9, < 3)
openid_connect (~> 1.1) openid_connect (~> 1.1)
GIT GIT
@ -139,8 +139,8 @@ GEM
minitest (>= 5.1) minitest (>= 5.1)
tzinfo (~> 2.0) tzinfo (~> 2.0)
zeitwerk (~> 2.3) zeitwerk (~> 2.3)
addressable (2.8.0) addressable (2.8.1)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 6.0)
aes_key_wrap (1.1.0) aes_key_wrap (1.1.0)
airbrake (11.0.3) airbrake (11.0.3)
airbrake-ruby (~> 5.1) airbrake-ruby (~> 5.1)
@ -168,7 +168,7 @@ GEM
aws-sigv4 (1.2.4) aws-sigv4 (1.2.4)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.16) bcrypt (3.1.16)
bindata (2.4.10) bindata (2.4.14)
bootsnap (1.9.3) bootsnap (1.9.3)
msgpack (~> 1.0) msgpack (~> 1.0)
bootstrap-sass (3.4.1) bootstrap-sass (3.4.1)
@ -224,17 +224,27 @@ GEM
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
erubi (1.10.0) erubi (1.10.0)
execjs (2.7.0) execjs (2.7.0)
faraday (2.6.0)
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.0.1)
ffi (1.15.0) ffi (1.15.0)
figaro (1.2.0) figaro (1.2.0)
thor (>= 0.14.0, < 2) thor (>= 0.14.0, < 2)
globalid (0.5.2) globalid (0.5.2)
activesupport (>= 5.0) activesupport (>= 5.0)
google-protobuf (3.19.4) google-protobuf (3.19.4)
google-protobuf (3.19.4-x86_64-linux)
googleapis-common-protos-types (1.3.0) googleapis-common-protos-types (1.3.0)
google-protobuf (~> 3.14) google-protobuf (~> 3.14)
grpc (1.41.1) grpc (1.41.1)
google-protobuf (~> 3.17) google-protobuf (~> 3.17)
googleapis-common-protos-types (~> 1.0) googleapis-common-protos-types (~> 1.0)
grpc (1.41.1-x86_64-linux)
google-protobuf (~> 3.17)
googleapis-common-protos-types (~> 1.0)
gyoku (1.3.1) gyoku (1.3.1)
builder (>= 2.1.2) builder (>= 2.1.2)
haml (6.0.0) haml (6.0.0)
@ -264,10 +274,12 @@ GEM
jquery-ui-rails (6.0.1) jquery-ui-rails (6.0.1)
railties (>= 3.2.16) railties (>= 3.2.16)
json (2.5.1) json (2.5.1)
json-jwt (1.13.0) json-jwt (1.16.1)
activesupport (>= 4.2) activesupport (>= 4.2)
aes_key_wrap aes_key_wrap
bindata bindata
faraday (~> 2.0)
faraday-follow_redirects
jwt (2.3.0) jwt (2.3.0)
kaminari (1.2.1) kaminari (1.2.1)
activesupport (>= 4.1.0) activesupport (>= 4.1.0)
@ -296,7 +308,7 @@ GEM
mimemagic (0.4.3) mimemagic (0.4.3)
nokogiri (~> 1) nokogiri (~> 1)
rake rake
mini_mime (1.1.1) mini_mime (1.1.2)
mini_portile2 (2.8.0) mini_portile2 (2.8.0)
minitest (5.16.3) minitest (5.16.3)
monetize (1.9.4) monetize (1.9.4)
@ -309,6 +321,10 @@ GEM
money (~> 6.13.2) money (~> 6.13.2)
railties (>= 3.0) railties (>= 3.0)
msgpack (1.4.2) msgpack (1.4.2)
net-protocol (0.1.3)
timeout
net-smtp (0.3.3)
net-protocol
netrc (0.11.0) netrc (0.11.0)
newrelic-infinite_tracing (8.1.0) newrelic-infinite_tracing (8.1.0)
grpc (~> 1.34) grpc (~> 1.34)
@ -321,22 +337,24 @@ GEM
nokogiri (1.13.9-x86_64-linux) nokogiri (1.13.9-x86_64-linux)
racc (~> 1.4) racc (~> 1.4)
nori (2.6.0) nori (2.6.0)
omniauth (1.9.2) omniauth (2.1.0)
hashie (>= 3.4.6) hashie (>= 3.4.6)
rack (>= 1.6.2, < 3) rack (>= 2.2.3)
rack-protection
omniauth-rails_csrf_protection (0.1.2) omniauth-rails_csrf_protection (0.1.2)
actionpack (>= 4.2) actionpack (>= 4.2)
omniauth (>= 1.3.1) omniauth (>= 1.3.1)
openid_connect (1.3.0) openid_connect (1.4.2)
activemodel activemodel
attr_required (>= 1.0.0) attr_required (>= 1.0.0)
json-jwt (>= 1.5.0) json-jwt (>= 1.15.0)
rack-oauth2 (>= 1.6.1) net-smtp
swd (>= 1.0.0) rack-oauth2 (~> 1.21)
swd (~> 1.3)
tzinfo tzinfo
validate_email validate_email
validate_url validate_url
webfinger (>= 1.0.1) webfinger (~> 1.2)
orm_adapter (0.5.0) orm_adapter (0.5.0)
paper_trail (13.0.0) paper_trail (13.0.0)
activerecord (>= 5.2) activerecord (>= 5.2)
@ -350,17 +368,19 @@ GEM
pry (0.14.1) pry (0.14.1)
coderay (~> 1.1) coderay (~> 1.1)
method_source (~> 1.0) method_source (~> 1.0)
public_suffix (4.0.6) public_suffix (5.0.0)
puma (5.6.4) puma (5.6.4)
nio4r (~> 2.0) nio4r (~> 2.0)
racc (1.6.0) racc (1.6.0)
rack (2.2.4) rack (2.2.4)
rack-oauth2 (1.16.0) rack-oauth2 (1.21.3)
activesupport activesupport
attr_required attr_required
httpclient httpclient
json-jwt (>= 1.11.0) json-jwt (>= 1.11.0)
rack (>= 2.1.0) rack (>= 2.1.0)
rack-protection (3.0.2)
rack
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (6.1.4.1) rails (6.1.4.1)
@ -408,6 +428,7 @@ GEM
mime-types (>= 1.16, < 4.0) mime-types (>= 1.16, < 4.0)
netrc (~> 0.8) netrc (~> 0.8)
rexml (3.2.5) rexml (3.2.5)
ruby2_keywords (0.0.5)
rubyzip (2.3.2) rubyzip (2.3.2)
sass-rails (6.0.0) sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1) sassc-rails (~> 2.1, >= 2.1.1)
@ -460,6 +481,7 @@ GEM
temple (0.8.2) temple (0.8.2)
thor (1.2.1) thor (1.2.1)
tilt (2.0.11) tilt (2.0.11)
timeout (0.3.0)
truemail (2.4.9) truemail (2.4.9)
simpleidn (~> 0.2.1) simpleidn (~> 0.2.1)
tzinfo (2.0.5) tzinfo (2.0.5)
@ -502,7 +524,7 @@ GEM
wkhtmltopdf-binary (0.12.5.4) wkhtmltopdf-binary (0.12.5.4)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.6.4) zeitwerk (2.6.6)
PLATFORMS PLATFORMS
ruby ruby
@ -575,4 +597,4 @@ DEPENDENCIES
wkhtmltopdf-binary (~> 0.12.5.1) wkhtmltopdf-binary (~> 0.12.5.1)
BUNDLED WITH BUNDLED WITH
2.3.23 2.3.25

View file

@ -58,10 +58,11 @@ module Serializers
} }
end end
def statuses def statuses(statuses_with_notes = {})
statuses_with_notes = domain.status_notes status_notes = domain.status_notes
domain.statuses.each do |status| 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 end
statuses_with_notes statuses_with_notes
end end