Permalink
Browse files

Merge pull request #1219 from tsigo/ruby19_hashes

Fully embrace Ruby 1.9 hash syntax
  • Loading branch information...
2 parents 1413c23 + 42d3295 commit ac525a74ee2862d0012a443059954288d4634acd @dzaporozhets dzaporozhets committed Aug 11, 2012
Showing with 1,448 additions and 1,448 deletions.
  1. +5 −5 app/contexts/commit_load.rb
  2. +3 −3 app/contexts/issues_bulk_update_context.rb
  3. +3 −3 app/controllers/admin/projects_controller.rb
  4. +1 −1 app/controllers/admin/users_controller.rb
  5. +7 −7 app/controllers/application_controller.rb
  6. +5 −5 app/controllers/commits_controller.rb
  7. +2 −2 app/controllers/dashboard_controller.rb
  8. +1 −1 app/controllers/deploy_keys_controller.rb
  9. +1 −1 app/controllers/hooks_controller.rb
  10. +14 −14 app/controllers/issues_controller.rb
  11. +1 −1 app/controllers/keys_controller.rb
  12. +9 −9 app/controllers/merge_requests_controller.rb
  13. +3 −3 app/controllers/milestones_controller.rb
  14. +3 −3 app/controllers/notes_controller.rb
  15. +1 −1 app/controllers/profile_controller.rb
  16. +5 −5 app/controllers/projects_controller.rb
  17. +2 −2 app/controllers/protected_branches_controller.rb
  18. +7 −7 app/controllers/refs_controller.rb
  19. +2 −2 app/controllers/search_controller.rb
  20. +8 −8 app/controllers/snippets_controller.rb
  21. +2 −2 app/controllers/team_members_controller.rb
  22. +8 −8 app/controllers/wikis_controller.rb
  23. +1 −1 app/decorators/application_decorator.rb
  24. +1 −1 app/decorators/event_decorator.rb
  25. +3 −3 app/decorators/tree_decorator.rb
  26. +15 −15 app/helpers/application_helper.rb
  27. +10 −10 app/helpers/gitlab_markdown_helper.rb
  28. +2 −2 app/helpers/issues_helper.rb
  29. +6 −6 app/helpers/merge_requests_helper.rb
  30. +2 −2 app/helpers/tab_helper.rb
  31. +10 −10 app/mailers/notify.rb
  32. +6 −6 app/models/commit.rb
  33. +6 −6 app/models/event.rb
  34. +1 −1 app/models/issue.rb
  35. +6 −6 app/models/key.rb
  36. +10 −10 app/models/merge_request.rb
  37. +1 −1 app/models/milestone.rb
  38. +19 −19 app/models/note.rb
  39. +36 −36 app/models/project.rb
  40. +10 −10 app/models/snippet.rb
  41. +1 −1 app/models/tree.rb
  42. +36 −36 app/models/user.rb
  43. +5 −5 app/models/users_project.rb
  44. +3 −3 app/models/wiki.rb
  45. +10 −10 app/observers/activity_observer.rb
  46. +1 −1 app/observers/mailer_observer.rb
  47. +2 −2 app/roles/account.rb
  48. +13 −13 app/roles/authority.rb
  49. +14 −14 app/roles/issue_commonality.rb
  50. +5 −5 app/roles/project_push.rb
  51. +1 −1 app/roles/ssh_key.rb
  52. +2 −2 app/roles/team.rb
  53. +2 −2 app/uploaders/attachment_uploader.rb
  54. +4 −4 app/views/admin/dashboard/index.html.haml
  55. +6 −6 app/views/admin/hooks/index.html.haml
  56. +6 −6 app/views/admin/projects/_form.html.haml
  57. +1 −1 app/views/admin/projects/edit.html.haml
  58. +8 −8 app/views/admin/projects/index.html.haml
  59. +1 −1 app/views/admin/projects/new.html.haml
  60. +10 −10 app/views/admin/projects/show.html.haml
  61. +1 −1 app/views/admin/resque/show.html.haml
  62. +4 −4 app/views/admin/team_members/_form.html.haml
  63. +10 −10 app/views/admin/users/_form.html.haml
  64. +17 −17 app/views/admin/users/index.html.haml
  65. +11 −11 app/views/admin/users/show.html.haml
  66. +4 −4 app/views/commits/_commit.html.haml
  67. +3 −3 app/views/commits/_commit_box.html.haml
  68. +4 −4 app/views/commits/_diff_head.html.haml
  69. +8 −8 app/views/commits/_diffs.html.haml
  70. +8 −8 app/views/commits/_head.html.haml
  71. +7 −7 app/views/commits/_text_file.html.haml
  72. +5 −5 app/views/commits/compare.html.haml
  73. +3 −3 app/views/commits/index.html.haml
  74. +1 −1 app/views/commits/index.js.haml
  75. +2 −2 app/views/commits/show.html.haml
  76. +9 −9 app/views/dashboard/index.html.haml
  77. +2 −2 app/views/dashboard/issues.html.haml
  78. +2 −2 app/views/dashboard/merge_requests.html.haml
  79. +4 −4 app/views/deploy_keys/_form.html.haml
  80. +2 −2 app/views/deploy_keys/_show.html.haml
  81. +2 −2 app/views/deploy_keys/index.html.haml
  82. +1 −1 app/views/deploy_keys/show.html.haml
  83. +6 −6 app/views/devise/passwords/edit.html.haml
  84. +1 −1 app/views/errors/access_denied.html.haml
  85. +3 −3 app/views/events/_commit.html.haml
  86. +3 −3 app/views/events/_event.html.haml
  87. +2 −2 app/views/events/_event_issue.html.haml
  88. +4 −4 app/views/events/_event_last_push.html.haml
  89. +2 −2 app/views/events/_event_merge_request.html.haml
  90. +5 −5 app/views/events/_event_push.html.haml
  91. +4 −4 app/views/help/api.html.haml
  92. +6 −6 app/views/hooks/index.html.haml
  93. +11 −11 app/views/issues/_form.html.haml
  94. +6 −6 app/views/issues/_head.html.haml
  95. +2 −2 app/views/issues/_issues.html.haml
  96. +8 −8 app/views/issues/_show.html.haml
  97. +1 −1 app/views/issues/create.js.haml
  98. +22 −22 app/views/issues/index.html.haml
  99. +7 −7 app/views/issues/show.html.haml
  100. +1 −1 app/views/kaminari/admin/_first_page.html.haml
  101. +1 −1 app/views/kaminari/admin/_last_page.html.haml
  102. +1 −1 app/views/kaminari/admin/_next_page.html.haml
  103. +2 −2 app/views/kaminari/admin/_page.html.haml
  104. +2 −2 app/views/kaminari/admin/_prev_page.html.haml
  105. +1 −1 app/views/kaminari/gitlab/_first_page.html.haml
  106. +1 −1 app/views/kaminari/gitlab/_last_page.html.haml
  107. +1 −1 app/views/kaminari/gitlab/_next_page.html.haml
  108. +2 −2 app/views/kaminari/gitlab/_page.html.haml
  109. +1 −1 app/views/kaminari/gitlab/_prev_page.html.haml
  110. +3 −3 app/views/keys/_form.html.haml
  111. +1 −1 app/views/keys/_show.html.haml
  112. +1 −1 app/views/keys/create.js.haml
  113. +3 −3 app/views/keys/index.html.haml
  114. +1 −1 app/views/keys/show.html.haml
  115. +6 −6 app/views/layouts/_app_menu.html.haml
  116. +1 −1 app/views/layouts/_flash.html.haml
  117. +4 −4 app/views/layouts/_head.html.haml
  118. +8 −8 app/views/layouts/_head_panel.html.haml
  119. +9 −9 app/views/layouts/_project_menu.html.haml
  120. +9 −9 app/views/layouts/admin.html.haml
  121. +4 −4 app/views/layouts/application.html.haml
  122. +2 −2 app/views/layouts/devise_layout.html.haml
  123. +3 −3 app/views/layouts/error.html.haml
  124. +14 −14 app/views/layouts/notify.html.haml
  125. +8 −8 app/views/layouts/profile.html.haml
  126. +4 −4 app/views/layouts/project.html.haml
  127. +10 −10 app/views/merge_requests/_form.html.haml
  128. +1 −1 app/views/merge_requests/_head.html.haml
  129. +3 −3 app/views/merge_requests/_merge_request.html.haml
  130. +4 −4 app/views/merge_requests/_show.html.haml
  131. +1 −1 app/views/merge_requests/branch_from.js.haml
  132. +1 −1 app/views/merge_requests/branch_to.js.haml
  133. +1 −1 app/views/merge_requests/commits.js.haml
  134. +1 −1 app/views/merge_requests/diffs.js.haml
  135. +10 −10 app/views/merge_requests/index.html.haml
  136. +1 −1 app/views/merge_requests/show.js.haml
  137. +3 −3 app/views/merge_requests/show/_commits.html.haml
  138. +2 −2 app/views/merge_requests/show/_diffs.html.haml
  139. +1 −1 app/views/merge_requests/show/_how_to_merge.html.haml
  140. +8 −8 app/views/merge_requests/show/_mr_accept.html.haml
  141. +2 −2 app/views/merge_requests/show/_mr_box.html.haml
  142. +3 −3 app/views/merge_requests/show/_mr_title.html.haml
  143. +11 −11 app/views/milestones/_form.html.haml
  144. +5 −5 app/views/milestones/_milestone.html.haml
  145. +6 −6 app/views/milestones/index.html.haml
  146. +6 −6 app/views/milestones/show.html.haml
  147. +1 −1 app/views/notes/_create_common.js.haml
  148. +2 −2 app/views/notes/_create_line.js.haml
  149. +6 −6 app/views/notes/_form.html.haml
  150. +3 −3 app/views/notes/_load.js.haml
  151. +1 −1 app/views/notes/_notes_list.html.haml
  152. +6 −6 app/views/notes/_per_line_form.html.haml
  153. +2 −2 app/views/notes/_per_line_show.html.haml
  154. +2 −2 app/views/notes/_reply_button.html.haml
  155. +4 −4 app/views/notes/_show.html.haml
  156. +2 −2 app/views/notes/create.js.haml
  157. +10 −10 app/views/notify/new_issue_email.html.haml
  158. +11 −11 app/views/notify/new_merge_request_email.html.haml
  159. +13 −13 app/views/notify/new_user_email.html.haml
  160. +15 −15 app/views/notify/note_commit_email.html.haml
  161. +15 −15 app/views/notify/note_issue_email.html.haml
  162. +15 −15 app/views/notify/note_merge_request_email.html.haml
  163. +15 −15 app/views/notify/note_wall_email.html.haml
  164. +15 −15 app/views/notify/note_wiki_email.html.haml
  165. +10 −10 app/views/notify/reassigned_issue_email.html.haml
  166. +10 −10 app/views/notify/reassigned_merge_request_email.html.haml
  167. +5 −5 app/views/profile/design.html.haml
  168. +2 −2 app/views/profile/password.html.haml
  169. +17 −17 app/views/profile/show.html.haml
  170. +4 −4 app/views/profile/token.html.haml
  171. +8 −8 app/views/projects/_form.html.haml
  172. +5 −5 app/views/projects/_new_form.html.haml
  173. +12 −12 app/views/projects/_project_head.html.haml
  174. +2 −2 app/views/projects/_refs.html.haml
  175. +3 −3 app/views/projects/_show.html.haml
  176. +1 −1 app/views/projects/_team.html.haml
  177. +1 −1 app/views/projects/create.js.haml
  178. +2 −2 app/views/projects/empty.html.haml
  179. +2 −2 app/views/projects/files.html.haml
  180. +7 −7 app/views/projects/show.html.haml
  181. +3 −3 app/views/projects/team.html.haml
  182. +1 −1 app/views/projects/tree.js.haml
  183. +1 −1 app/views/projects/update.js.haml
  184. +1 −1 app/views/projects/wall.html.haml
  185. +7 −7 app/views/protected_branches/index.html.haml
  186. +3 −3 app/views/refs/_head.html.haml
  187. +3 −3 app/views/refs/_submodule_item.html.haml
  188. +9 −9 app/views/refs/_tree.html.haml
  189. +1 −1 app/views/refs/_tree_commit.html.haml
  190. +7 −7 app/views/refs/_tree_file.html.haml
  191. +3 −3 app/views/refs/_tree_item.html.haml
  192. +6 −6 app/views/refs/blame.html.haml
  193. +1 −1 app/views/refs/logs_tree.js.haml
  194. +1 −1 app/views/refs/tree.html.haml
  195. +1 −1 app/views/refs/tree.js.haml
  196. +6 −6 app/views/repositories/_branch.html.haml
  197. +3 −3 app/views/repositories/_branches_head.html.haml
  198. +3 −3 app/views/repositories/_feed.html.haml
  199. +1 −1 app/views/repositories/branches.html.haml
  200. +1 −1 app/views/repositories/show.html.haml
  201. +4 −4 app/views/repositories/tags.html.haml
  202. +5 −5 app/views/search/show.html.haml
  203. +7 −7 app/views/snippets/_form.html.haml
  204. +2 −2 app/views/snippets/_snippet.html.haml
  205. +2 −2 app/views/snippets/index.html.haml
  206. +4 −4 app/views/snippets/show.html.haml
  207. +5 −5 app/views/team_members/_form.html.haml
  208. +7 −7 app/views/team_members/_show.html.haml
  209. +6 −6 app/views/team_members/show.html.haml
  210. +4 −4 app/views/wikis/_form.html.haml
  211. +1 −1 app/views/wikis/history.html.haml
  212. +1 −1 app/views/wikis/pages.html.haml
  213. +5 −5 app/views/wikis/show.html.haml
  214. +1 −1 lib/api.rb
  215. +6 −6 lib/api/entities.rb
  216. +16 −16 lib/api/issues.rb
  217. +16 −16 lib/api/projects.rb
  218. +3 −3 lib/api/users.rb
  219. +2 −2 lib/file_size_validator.rb
  220. +1 −1 lib/gitlab/encode.rb
  221. +1 −1 lib/graph_commit.rb
  222. +2 −2 lib/redcarpet/render/gitlab_html.rb
  223. +4 −4 spec/api/issues_spec.rb
  224. +4 −4 spec/api/projects_spec.rb
  225. +50 −50 spec/helpers/gitlab_flavored_markdown_spec.rb
  226. +13 −13 spec/mailers/notify_spec.rb
  227. +4 −4 spec/models/activity_observer_spec.rb
  228. +15 −15 spec/models/event_spec.rb
  229. +8 −8 spec/models/issue_observer_spec.rb
  230. +16 −16 spec/models/issue_spec.rb
  231. +8 −8 spec/models/merge_request_spec.rb
  232. +4 −4 spec/models/milestone_spec.rb
  233. +17 −17 spec/models/note_spec.rb
  234. +1 −1 spec/models/project_hooks_spec.rb
  235. +4 −4 spec/models/project_security_spec.rb
  236. +10 −10 spec/models/project_spec.rb
  237. +2 −2 spec/models/protected_branch_spec.rb
  238. +1 −1 spec/models/system_hook_spec.rb
  239. +7 −7 spec/models/user_spec.rb
  240. +3 −3 spec/requests/admin/admin_hooks_spec.rb
  241. +8 −8 spec/requests/admin/admin_projects_spec.rb
  242. +8 −8 spec/requests/admin/admin_users_spec.rb
  243. +17 −17 spec/requests/atom/dashboard_issues_spec.rb
  244. +3 −3 spec/requests/atom/dashboard_spec.rb
  245. +10 −10 spec/requests/atom/issues_spec.rb
  246. +40 −40 spec/requests/gitlab_flavored_markdown_spec.rb
  247. +3 −3 spec/requests/hooks_spec.rb
  248. +15 −15 spec/requests/issues_spec.rb
  249. +4 −4 spec/requests/projects_deploy_keys_spec.rb
  250. +4 −4 spec/requests/projects_spec.rb
  251. +1 −1 spec/requests/search_spec.rb
  252. +3 −3 spec/requests/security/project_access_spec.rb
  253. +10 −10 spec/requests/snippets_spec.rb
  254. +3 −3 spec/spec_helper.rb
  255. +9 −9 spec/support/login.rb
  256. +1 −1 spec/workers/post_receive_spec.rb
@@ -1,11 +1,11 @@
class CommitLoad < BaseContext
def execute
result = {
- :commit => nil,
- :suppress_diff => false,
- :line_notes => [],
- :notes_count => 0,
- :note => nil
+ commit: nil,
+ suppress_diff: false,
+ line_notes: [],
+ notes_count: 0,
+ note: nil
}
commit = project.commit(params[:id])
@@ -12,12 +12,12 @@ def execute
opts[:assignee_id] = assignee_id if assignee_id.present?
opts[:closed] = (status == "closed") if status.present?
- issues = Issue.where(:id => issues_ids).all
+ issues = Issue.where(id: issues_ids).all
issues = issues.select { |issue| can?(current_user, :modify_issue, issue) }
issues.each { |issue| issue.update_attributes(opts) }
{
- :count => issues.count,
- :success => !issues.count.zero?
+ count: issues.count,
+ success: !issues.count.zero?
}
end
end
@@ -2,7 +2,7 @@ class Admin::ProjectsController < ApplicationController
layout "admin"
before_filter :authenticate_user!
before_filter :authenticate_admin!
- before_filter :admin_project, :only => [:edit, :show, :update, :destroy, :team_update]
+ before_filter :admin_project, only: [:edit, :show, :update, :destroy, :team_update]
def index
@admin_projects = Project.scoped
@@ -36,7 +36,7 @@ def create
if @admin_project.save
redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
else
- render :action => "new"
+ render action: "new"
end
end
@@ -50,7 +50,7 @@ def update
if @admin_project.update_attributes(params[:project])
redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
else
- render :action => "edit"
+ render action: "edit"
end
end
@@ -34,7 +34,7 @@ def team_update
def new
- @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit)
+ @admin_user = User.new(projects_limit: Gitlab.config.default_projects_limit)
end
def edit
@@ -11,15 +11,15 @@ class ApplicationController < ActionController::Base
helper_method :abilities, :can?
rescue_from Gitlab::Gitolite::AccessDenied do |exception|
- render "errors/gitolite", :layout => "error"
+ render "errors/gitolite", layout: "error"
end
rescue_from Encoding::CompatibilityError do |exception|
- render "errors/encoding", :layout => "error", :status => 404
+ render "errors/encoding", layout: "error", status: 404
end
rescue_from ActiveRecord::RecordNotFound do |exception|
- render "errors/not_found", :layout => "error", :status => 404
+ render "errors/not_found", layout: "error", status: 404
end
layout :layout_by_resource
@@ -97,15 +97,15 @@ def authorize_code_access!
end
def access_denied!
- render "errors/access_denied", :layout => "error", :status => 404
+ render "errors/access_denied", layout: "error", status: 404
end
def not_found!
- render "errors/not_found", :layout => "error", :status => 404
+ render "errors/not_found", layout: "error", status: 404
end
def git_not_found!
- render "errors/git_not_found", :layout => "error", :status => 404
+ render "errors/git_not_found", layout: "error", status: 404
end
def method_missing(method_sym, *arguments, &block)
@@ -127,7 +127,7 @@ def load_refs
end
def render_404
- render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404"
+ render file: File.join(Rails.root, "public", "404"), layout: false, status: "404"
end
def require_non_empty_project
@@ -9,7 +9,7 @@ class CommitsController < ApplicationController
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
- before_filter :load_refs, :only => :index # load @branch, @tag & @ref
+ before_filter :load_refs, only: :index # load @branch, @tag & @ref
before_filter :render_full_content
def index
@@ -22,7 +22,7 @@ def index
respond_to do |format|
format.html # index.html.erb
format.js
- format.atom { render :layout => false }
+ format.atom { render layout: false }
end
end
@@ -61,9 +61,9 @@ def patch
send_data(
@commit.to_patch,
- :type => "text/plain",
- :disposition => 'attachment',
- :filename => (@commit.id.to_s + ".patch")
+ type: "text/plain",
+ disposition: 'attachment',
+ filename: (@commit.id.to_s + ".patch")
)
end
end
@@ -9,7 +9,7 @@ def index
respond_to do |format|
format.html
format.js
- format.atom { render :layout => false }
+ format.atom { render layout: false }
end
end
@@ -28,7 +28,7 @@ def issues
respond_to do |format|
format.html
- format.atom { render :layout => false }
+ format.atom { render layout: false }
end
end
end
@@ -40,7 +40,7 @@ def destroy
respond_to do |format|
format.html { redirect_to project_deploy_keys_url }
- format.js { render :nothing => true }
+ format.js { render nothing: true }
end
end
end
@@ -6,7 +6,7 @@ class HooksController < ApplicationController
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
- before_filter :authorize_admin_project!, :only => [:new, :create, :destroy]
+ before_filter :authorize_admin_project!, only: [:new, :create, :destroy]
respond_to :html
@@ -2,7 +2,7 @@ class IssuesController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :module_enabled
- before_filter :issue, :only => [:edit, :update, :destroy, :show]
+ before_filter :issue, only: [:edit, :update, :destroy, :show]
helper_method :issues_filter
layout "project"
@@ -14,13 +14,13 @@ class IssuesController < ApplicationController
before_filter :authorize_read_issue!
# Allow write(create) issue
- before_filter :authorize_write_issue!, :only => [:new, :create]
+ before_filter :authorize_write_issue!, only: [:new, :create]
# Allow modify issue
- before_filter :authorize_modify_issue!, :only => [:close, :edit, :update]
+ before_filter :authorize_modify_issue!, only: [:close, :edit, :update]
# Allow destroy issue
- before_filter :authorize_admin_issue!, :only => [:destroy]
+ before_filter :authorize_admin_issue!, only: [:destroy]
respond_to :js, :html
@@ -32,7 +32,7 @@ def index
respond_to do |format|
format.html # index.html.erb
format.js
- format.atom { render :layout => false }
+ format.atom { render layout: false }
end
end
@@ -46,7 +46,7 @@ def edit
end
def show
- @note = @project.notes.new(:noteable => @issue)
+ @note = @project.notes.new(noteable: @issue)
respond_to do |format|
format.html
@@ -66,7 +66,7 @@ def create
end
def update
- @issue.update_attributes(params[:issue].merge(:author_id_of_changes => current_user.id))
+ @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id))
respond_to do |format|
format.js
@@ -87,20 +87,20 @@ def destroy
respond_to do |format|
format.html { redirect_to project_issues_path }
- format.js { render :nothing => true }
+ format.js { render nothing: true }
end
end
def sort
return render_404 unless can?(current_user, :admin_issue, @project)
- @issues = @project.issues.where(:id => params['issue'])
+ @issues = @project.issues.where(id: params['issue'])
@issues.each do |issue|
issue.position = params['issue'].index(issue.id.to_s) + 1
issue.save
end
- render :nothing => true
+ render nothing: true
end
def search
@@ -110,12 +110,12 @@ def search
@issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank?
@issues = @issues.page(params[:page]).per(100)
- render :partial => 'issues'
+ render partial: 'issues'
end
def bulk_update
result = IssuesBulkUpdateContext.new(project, current_user, params).execute
- redirect_to :back, :notice => "#{result[:count]} issues updated"
+ redirect_to :back, notice: "#{result[:count]} issues updated"
end
protected
@@ -144,8 +144,8 @@ def issues_filtered
else @project.issues.opened
end
- @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present?
- @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present?
+ @issues = @issues.where(assignee_id: params[:assignee_id]) if params[:assignee_id].present?
+ @issues = @issues.where(milestone_id: params[:milestone_id]) if params[:milestone_id].present?
@issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present?
@issues = @issues.includes(:author, :project).order("updated_at")
@issues
@@ -29,7 +29,7 @@ def destroy
respond_to do |format|
format.html { redirect_to keys_url }
- format.js { render :nothing => true }
+ format.js { render nothing: true }
end
end
end
@@ -2,9 +2,9 @@ class MergeRequestsController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :module_enabled
- before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]
- before_filter :validates_merge_request, :only => [:show, :diffs, :raw]
- before_filter :define_show_vars, :only => [:show, :diffs]
+ before_filter :merge_request, only: [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]
+ before_filter :validates_merge_request, only: [:show, :diffs, :raw]
+ before_filter :define_show_vars, only: [:show, :diffs]
layout "project"
# Authorize
@@ -14,13 +14,13 @@ class MergeRequestsController < ApplicationController
before_filter :authorize_read_merge_request!
# Allow write(create) merge_request
- before_filter :authorize_write_merge_request!, :only => [:new, :create]
+ before_filter :authorize_write_merge_request!, only: [:new, :create]
# Allow modify merge_request
- before_filter :authorize_modify_merge_request!, :only => [:close, :edit, :update, :sort]
+ before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
# Allow destroy merge_request
- before_filter :authorize_admin_merge_request!, :only => [:destroy]
+ before_filter :authorize_admin_merge_request!, only: [:destroy]
def index
@@ -66,7 +66,7 @@ def create
end
def update
- if @merge_request.update_attributes(params[:merge_request].merge(:author_id_of_changes => current_user.id))
+ if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id))
@merge_request.reload_code
@merge_request.mark_as_unchecked
redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.'
@@ -79,7 +79,7 @@ def automerge_check
if @merge_request.unchecked?
@merge_request.check_if_can_be_merged
end
- render :json => {:state => @merge_request.human_state}
+ render json: {state: @merge_request.human_state}
end
def automerge
@@ -138,7 +138,7 @@ def validates_merge_request
def define_show_vars
# Build a note object for comment form
- @note = @project.notes.new(:noteable => @merge_request)
+ @note = @project.notes.new(noteable: @merge_request)
# Get commits from repository
# or from cache if already merged
@@ -2,7 +2,7 @@ class MilestonesController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :module_enabled
- before_filter :milestone, :only => [:edit, :update, :destroy, :show]
+ before_filter :milestone, only: [:edit, :update, :destroy, :show]
layout "project"
# Authorize
@@ -12,7 +12,7 @@ class MilestonesController < ApplicationController
before_filter :authorize_read_milestone!
# Allow admin milestone
- before_filter :authorize_admin_milestone!, :except => [:index, :show]
+ before_filter :authorize_admin_milestone!, except: [:index, :show]
respond_to :html
@@ -77,7 +77,7 @@ def destroy
respond_to do |format|
format.html { redirect_to project_milestones_path }
- format.js { render :nothing => true }
+ format.js { render nothing: true }
end
end
Oops, something went wrong.

0 comments on commit ac525a7

Please sign in to comment.