Commit 79e3fe67 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '338923-event-subtransaction-removal' into 'master'

Remove substransaction from wiki event creation

See merge request gitlab-org/gitlab!68627
parents 3d823895 18e78d23
......@@ -10,11 +10,9 @@ module WikiPages
end
def execute(slug, page, action, event_fingerprint)
event = Event.transaction do
wiki_page_meta = WikiPage::Meta.find_or_create(slug, page)
::EventCreateService.new.wiki_event(wiki_page_meta, author, action, event_fingerprint)
end
event = ::EventCreateService.new.wiki_event(wiki_page_meta, author, action, event_fingerprint)
ServiceResponse.success(payload: { event: event })
rescue ::EventCreateService::IllegalActionError, ::ActiveRecord::ActiveRecordError => e
......
......@@ -34,10 +34,6 @@ RSpec.describe WikiPages::EventCreateService do
it 'does not create an event' do
expect { response }.not_to change(Event, :count)
end
it 'does not create a metadata record' do
expect { response }.not_to change(WikiPage::Meta, :count)
end
end
it 'returns a successful response' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment