summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-08-31 00:58:39 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-08-31 00:58:39 +0800
commitc6371ae929d9a733c658de6d3e22ff60a1e7e8e4 (patch)
tree08152642eb9e9edf86b7897c74f6c076389df915 /lib/api/helpers.rb
parentc5553ce772371295d2d7652cec899633042fae07 (diff)
parentf7c8434c7100c3c87eb2a75cd5a128e520d8c110 (diff)
downloadgitlab-ce-c6371ae929d9a733c658de6d3e22ff60a1e7e8e4.tar.gz
Merge remote-tracking branch 'upstream/master' into 36807-gc-unwanted-refs-after-import
* upstream/master: Don't use public_send in destroy_conditionally! helper Fix MySQL failure for emoji autocomplete max-width for lazy-loaded images (this was removed in the original MR through merge resolution most probably) Replace 'project/user_lookup.feature' spinach test with an rspec analog Move GPG signed commits docs to new location
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 84980864151..3d377fdb9eb 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -19,8 +19,10 @@ module API
end
end
- def destroy_conditionally!(resource, last_update_field: :updated_at)
- check_unmodified_since!(resource.public_send(last_update_field))
+ def destroy_conditionally!(resource, last_updated: nil)
+ last_updated ||= resource.updated_at
+
+ check_unmodified_since!(last_updated)
status 204
if block_given?