From 549c4c2202307608773a10d8ce9a7dc978537de4 Mon Sep 17 00:00:00 2001 From: Alex Denisov <1101.debian@gmail.com> Date: Sun, 16 Sep 2012 19:51:04 +0300 Subject: API attributes refactored --- lib/api/helpers.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 054eb2d3f70..d0fc8c434a2 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -28,6 +28,14 @@ module Gitlab end end + def existed_attributes(keys) + attrs = {} + keys.each do |key| + attrs[key] = params[key] if params[key].present? + end + attrs + end + # error helpers def forbidden! -- cgit v1.2.1