Make Geo::EventStore#create simpler

parent 59906167
......@@ -31,11 +31,7 @@ module Geo
def create
return unless Gitlab::Geo.primary?
Geo::EventLog.transaction do
event_log = Geo::EventLog.new
event_log.public_send("#{self.class.event_type}=", build_event)
event_log.save!
end
Geo::EventLog.create!("#{self.class.event_type}" => build_event)
rescue ActiveRecord::RecordInvalid, NoMethodError
log("#{self.event_type.to_s.humanize} could not be created")
end
......
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