PERF: omit user profile and private message stats in web hook serializer.
This commit is contained in:
parent
77300c1d8d
commit
871fcf1117
|
@ -533,4 +533,4 @@ DEPENDENCIES
|
||||||
webpush
|
webpush
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.17.3
|
2.0.1
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
class WebHookUserSerializer < UserSerializer
|
class WebHookUserSerializer < UserSerializer
|
||||||
attributes :external_id
|
attributes :external_id
|
||||||
|
|
||||||
|
def omit_stats
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
# remove staff attributes
|
# remove staff attributes
|
||||||
def staff_attributes(*attrs)
|
def staff_attributes(*attrs)
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,7 +23,7 @@ RSpec.describe WebHookUserSerializer do
|
||||||
|
|
||||||
it 'should only include the required keys' do
|
it 'should only include the required keys' do
|
||||||
count = serializer.as_json.keys.count
|
count = serializer.as_json.keys.count
|
||||||
difference = count - 45
|
difference = count - 43
|
||||||
|
|
||||||
expect(difference).to eq(0), lambda {
|
expect(difference).to eq(0), lambda {
|
||||||
message = ""
|
message = ""
|
||||||
|
|
Loading…
Reference in New Issue