X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fcc485725dac6c31c6e01db5142d15e9b35f6509..18453600aa5c208276c7d2f329952642924f4a75:/app/models/segment.rb diff --git a/app/models/segment.rb b/app/models/segment.rb index bdb807d93..6916b79b1 100644 --- a/app/models/segment.rb +++ b/app/models/segment.rb @@ -59,18 +59,12 @@ class Segment < ActiveRecord::Base return segment end - def save_with_history - begin - Segment.transaction do - self.timestamp = Time.now - self.save! - old_segment = OldSegment.from_segment(self) - old_segment.save! - end - - return true - rescue - return nil + def save_with_history! + Segment.transaction do + self.timestamp = Time.now + self.save! + old_segment = OldSegment.from_segment(self) + old_segment.save! end end