Trim `WebHookPostSerializer` further.
This commit is contained in:
parent
3ff0074e9d
commit
60e7b13f59
|
@ -374,6 +374,10 @@ class PostSerializer < BasicPostSerializer
|
|||
object.revisions.size > 0
|
||||
end
|
||||
|
||||
def include_hidden_reason_id?
|
||||
object.hidden
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def topic
|
||||
|
|
|
@ -12,6 +12,12 @@ class WebHookPostSerializer < PostSerializer
|
|||
can_delete
|
||||
can_recover
|
||||
can_wiki
|
||||
actions_summary
|
||||
can_view_edit_history
|
||||
yours
|
||||
primary_group_flair_url
|
||||
primary_group_flair_bg_color
|
||||
primary_group_flair_color
|
||||
}.each do |attr|
|
||||
define_method("include_#{attr}?") do
|
||||
false
|
||||
|
|
|
@ -10,7 +10,7 @@ RSpec.describe WebHookPostSerializer do
|
|||
|
||||
it 'should only include the required keys' do
|
||||
count = serialized_for_user(admin).keys.count
|
||||
difference = count - 41
|
||||
difference = count - 34
|
||||
|
||||
expect(difference).to eq(0), lambda {
|
||||
message = ""
|
||||
|
|
Loading…
Reference in New Issue