diff options
author | Alex Denisov <1101.debian@gmail.com> | 2012-09-16 20:08:57 +0300 |
---|---|---|
committer | Alex Denisov <1101.debian@gmail.com> | 2012-09-16 20:08:57 +0300 |
commit | b896880eb46c2b8167e2252d3656b5e38e35f6ec (patch) | |
tree | 0255ee4ee87e92d86c987741be165cfd7dcf58f7 | |
parent | 549c4c2202307608773a10d8ce9a7dc978537de4 (diff) | |
download | gitlab-ce-b896880eb46c2b8167e2252d3656b5e38e35f6ec.tar.gz |
Method name changed
-rw-r--r-- | lib/api/helpers.rb | 2 | ||||
-rw-r--r-- | lib/api/issues.rb | 4 | ||||
-rw-r--r-- | lib/api/milestones.rb | 4 | ||||
-rw-r--r-- | lib/api/projects.rb | 6 |
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index d0fc8c434a2..9a08b995800 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -28,7 +28,7 @@ module Gitlab end end - def existed_attributes(keys) + def attributes_for_keys(keys) attrs = {} keys.each do |key| attrs[key] = params[key] if params[key].present? diff --git a/lib/api/issues.rb b/lib/api/issues.rb index b177a4a86c8..4ee2d11f15f 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -48,7 +48,7 @@ module Gitlab # Example Request: # POST /projects/:id/issues post ":id/issues" do - attrs = existed_attributes [:title, :description, :assignee_id, :milestone_id] + attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id] attrs[:label_list] = params[:labels] if params[:labels].present? @issue = user_project.issues.new attrs @issue.author = current_user @@ -76,7 +76,7 @@ module Gitlab @issue = user_project.issues.find(params[:issue_id]) authorize! :modify_issue, @issue - attrs = existed_attributes [:title, :description, :assignee_id, :milestone_id, :closed] + attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id, :closed] attrs[:label_list] = params[:labels] if params[:labels].present? if @issue.update_attributes attrs present @issue, with: Entities::Issue diff --git a/lib/api/milestones.rb b/lib/api/milestones.rb index d5d3347a724..daaff940325 100644 --- a/lib/api/milestones.rb +++ b/lib/api/milestones.rb @@ -36,7 +36,7 @@ module Gitlab # Example Request: # POST /projects/:id/milestones post ":id/milestones" do - attrs = existed_attributes [:title, :description, :due_date] + attrs = attributes_for_keys [:title, :description, :due_date] @milestone = user_project.milestones.new attrs if @milestone.save present @milestone, with: Entities::Milestone @@ -60,7 +60,7 @@ module Gitlab authorize! :admin_milestone, user_project @milestone = user_project.milestones.find(params[:milestone_id]) - attrs = existed_attributes [:title, :description, :due_date, :closed] + attrs = attributes_for_keys [:title, :description, :due_date, :closed] if @milestone.update_attributes attrs present @milestone, with: Entities::Milestone else diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 4a2634720eb..1d9004f8eed 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -40,7 +40,7 @@ module Gitlab post do params[:code] ||= params[:name] params[:path] ||= params[:name] - attrs = existed_attributes [:code, + attrs = attributes_for_keys [:code, :path, :name, :description, @@ -207,7 +207,7 @@ module Gitlab # Example Request: # POST /projects/:id/snippets post ":id/snippets" do - attrs = existed_attributes [:title, :file_name] + attrs = attributes_for_keys [:title, :file_name] attrs[:expires_at] = params[:lifetime] if params[:lifetime].present? attrs[:content] = params[:code] if params[:code].present? @snippet = user_project.snippets.new attrs @@ -235,7 +235,7 @@ module Gitlab @snippet = user_project.snippets.find(params[:snippet_id]) authorize! :modify_snippet, @snippet - attrs = existed_attributes [:title, :file_name] + attrs = attributes_for_keys [:title, :file_name] attrs[:expires_at] = params[:lifetime] if params[:lifetime].present? attrs[:content] = params[:code] if params[:code].present? |