API attributes refactored

This commit is contained in:
Alex Denisov 2012-09-16 19:51:04 +03:00
parent caef9ed112
commit 549c4c2202
4 changed files with 36 additions and 52 deletions

View file

@ -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!