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