gitlab-org--gitlab-foss/lib/gitlab/data_builder/wiki_page.rb

23 lines
510 B
Ruby
Raw Normal View History

2017-07-20 11:12:06 -04:00
module Gitlab
module DataBuilder
module WikiPage
extend self
def build(wiki_page, user, action)
wiki = wiki_page.wiki
{
object_kind: wiki_page.class.name.underscore,
user: user.hook_attrs,
project: wiki.project.hook_attrs,
wiki: wiki.hook_attrs,
object_attributes: wiki_page.hook_attrs.merge(
url: Gitlab::UrlBuilder.build(wiki_page),
action: action
)
}
end
end
end
end