2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-24 12:49:21 +05:30
|
|
|
module Gitlab
|
|
|
|
module Timeless
|
2023-07-09 08:55:56 +05:30
|
|
|
def self.timeless(model)
|
2016-08-24 12:49:21 +05:30
|
|
|
original_record_timestamps = model.record_timestamps
|
|
|
|
model.record_timestamps = false
|
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
yield model
|
2016-08-24 12:49:21 +05:30
|
|
|
ensure
|
|
|
|
model.record_timestamps = original_record_timestamps
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|