Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/timeless.rb')
-rw-r--r--lib/gitlab/timeless.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab/timeless.rb b/lib/gitlab/timeless.rb
index 4f974c98c71..b72d33113dd 100644
--- a/lib/gitlab/timeless.rb
+++ b/lib/gitlab/timeless.rb
@@ -6,7 +6,8 @@ module Gitlab
original_record_timestamps = model.record_timestamps
model.record_timestamps = false
- if block.arity.abs == 1
+ # negative arity means arguments are optional
+ if block.arity == 1 || block.arity < 0
block.call(model)
else
block.call