Commit ac525a74ee2862d0012a443059954288d4634acd

Authored by Dmitriy Zaporozhets
2 parents 1413c23c 42d3295d

Merge pull request #1219 from tsigo/ruby19_hashes

Fully embrace Ruby 1.9 hash syntax
Showing 256 changed files with 1448 additions and 1448 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 256 files displayed.

app/contexts/commit_load.rb
1 class CommitLoad < BaseContext 1 class CommitLoad < BaseContext
2 def execute 2 def execute
3 result = { 3 result = {
4 - :commit => nil,  
5 - :suppress_diff => false,  
6 - :line_notes => [],  
7 - :notes_count => 0,  
8 - :note => nil 4 + commit: nil,
  5 + suppress_diff: false,
  6 + line_notes: [],
  7 + notes_count: 0,
  8 + note: nil
9 } 9 }
10 10
11 commit = project.commit(params[:id]) 11 commit = project.commit(params[:id])
app/contexts/issues_bulk_update_context.rb
@@ -12,12 +12,12 @@ class IssuesBulkUpdateContext &lt; BaseContext @@ -12,12 +12,12 @@ class IssuesBulkUpdateContext &lt; BaseContext
12 opts[:assignee_id] = assignee_id if assignee_id.present? 12 opts[:assignee_id] = assignee_id if assignee_id.present?
13 opts[:closed] = (status == "closed") if status.present? 13 opts[:closed] = (status == "closed") if status.present?
14 14
15 - issues = Issue.where(:id => issues_ids).all 15 + issues = Issue.where(id: issues_ids).all
16 issues = issues.select { |issue| can?(current_user, :modify_issue, issue) } 16 issues = issues.select { |issue| can?(current_user, :modify_issue, issue) }
17 issues.each { |issue| issue.update_attributes(opts) } 17 issues.each { |issue| issue.update_attributes(opts) }
18 { 18 {
19 - :count => issues.count,  
20 - :success => !issues.count.zero? 19 + count: issues.count,
  20 + success: !issues.count.zero?
21 } 21 }
22 end 22 end
23 end 23 end
app/controllers/admin/projects_controller.rb
@@ -2,7 +2,7 @@ class Admin::ProjectsController &lt; ApplicationController @@ -2,7 +2,7 @@ class Admin::ProjectsController &lt; ApplicationController
2 layout "admin" 2 layout "admin"
3 before_filter :authenticate_user! 3 before_filter :authenticate_user!
4 before_filter :authenticate_admin! 4 before_filter :authenticate_admin!
5 - before_filter :admin_project, :only => [:edit, :show, :update, :destroy, :team_update] 5 + before_filter :admin_project, only: [:edit, :show, :update, :destroy, :team_update]
6 6
7 def index 7 def index
8 @admin_projects = Project.scoped 8 @admin_projects = Project.scoped
@@ -36,7 +36,7 @@ class Admin::ProjectsController &lt; ApplicationController @@ -36,7 +36,7 @@ class Admin::ProjectsController &lt; ApplicationController
36 if @admin_project.save 36 if @admin_project.save
37 redirect_to [:admin, @admin_project], notice: 'Project was successfully created.' 37 redirect_to [:admin, @admin_project], notice: 'Project was successfully created.'
38 else 38 else
39 - render :action => "new" 39 + render action: "new"
40 end 40 end
41 end 41 end
42 42
@@ -50,7 +50,7 @@ class Admin::ProjectsController &lt; ApplicationController @@ -50,7 +50,7 @@ class Admin::ProjectsController &lt; ApplicationController
50 if @admin_project.update_attributes(params[:project]) 50 if @admin_project.update_attributes(params[:project])
51 redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.' 51 redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
52 else 52 else
53 - render :action => "edit" 53 + render action: "edit"
54 end 54 end
55 end 55 end
56 56
app/controllers/admin/users_controller.rb
@@ -34,7 +34,7 @@ class Admin::UsersController &lt; ApplicationController @@ -34,7 +34,7 @@ class Admin::UsersController &lt; ApplicationController
34 34
35 35
36 def new 36 def new
37 - @admin_user = User.new(:projects_limit => Gitlab.config.default_projects_limit) 37 + @admin_user = User.new(projects_limit: Gitlab.config.default_projects_limit)
38 end 38 end
39 39
40 def edit 40 def edit
app/controllers/application_controller.rb
@@ -11,15 +11,15 @@ class ApplicationController &lt; ActionController::Base @@ -11,15 +11,15 @@ class ApplicationController &lt; ActionController::Base
11 helper_method :abilities, :can? 11 helper_method :abilities, :can?
12 12
13 rescue_from Gitlab::Gitolite::AccessDenied do |exception| 13 rescue_from Gitlab::Gitolite::AccessDenied do |exception|
14 - render "errors/gitolite", :layout => "error" 14 + render "errors/gitolite", layout: "error"
15 end 15 end
16 16
17 rescue_from Encoding::CompatibilityError do |exception| 17 rescue_from Encoding::CompatibilityError do |exception|
18 - render "errors/encoding", :layout => "error", :status => 404 18 + render "errors/encoding", layout: "error", status: 404
19 end 19 end
20 20
21 rescue_from ActiveRecord::RecordNotFound do |exception| 21 rescue_from ActiveRecord::RecordNotFound do |exception|
22 - render "errors/not_found", :layout => "error", :status => 404 22 + render "errors/not_found", layout: "error", status: 404
23 end 23 end
24 24
25 layout :layout_by_resource 25 layout :layout_by_resource
@@ -97,15 +97,15 @@ class ApplicationController &lt; ActionController::Base @@ -97,15 +97,15 @@ class ApplicationController &lt; ActionController::Base
97 end 97 end
98 98
99 def access_denied! 99 def access_denied!
100 - render "errors/access_denied", :layout => "error", :status => 404 100 + render "errors/access_denied", layout: "error", status: 404
101 end 101 end
102 102
103 def not_found! 103 def not_found!
104 - render "errors/not_found", :layout => "error", :status => 404 104 + render "errors/not_found", layout: "error", status: 404
105 end 105 end
106 106
107 def git_not_found! 107 def git_not_found!
108 - render "errors/git_not_found", :layout => "error", :status => 404 108 + render "errors/git_not_found", layout: "error", status: 404
109 end 109 end
110 110
111 def method_missing(method_sym, *arguments, &block) 111 def method_missing(method_sym, *arguments, &block)
@@ -127,7 +127,7 @@ class ApplicationController &lt; ActionController::Base @@ -127,7 +127,7 @@ class ApplicationController &lt; ActionController::Base
127 end 127 end
128 128
129 def render_404 129 def render_404
130 - render :file => File.join(Rails.root, "public", "404"), :layout => false, :status => "404" 130 + render file: File.join(Rails.root, "public", "404"), layout: false, status: "404"
131 end 131 end
132 132
133 def require_non_empty_project 133 def require_non_empty_project
app/controllers/commits_controller.rb
@@ -9,7 +9,7 @@ class CommitsController &lt; ApplicationController @@ -9,7 +9,7 @@ class CommitsController &lt; ApplicationController
9 before_filter :authorize_read_project! 9 before_filter :authorize_read_project!
10 before_filter :authorize_code_access! 10 before_filter :authorize_code_access!
11 before_filter :require_non_empty_project 11 before_filter :require_non_empty_project
12 - before_filter :load_refs, :only => :index # load @branch, @tag & @ref 12 + before_filter :load_refs, only: :index # load @branch, @tag & @ref
13 before_filter :render_full_content 13 before_filter :render_full_content
14 14
15 def index 15 def index
@@ -22,7 +22,7 @@ class CommitsController &lt; ApplicationController @@ -22,7 +22,7 @@ class CommitsController &lt; ApplicationController
22 respond_to do |format| 22 respond_to do |format|
23 format.html # index.html.erb 23 format.html # index.html.erb
24 format.js 24 format.js
25 - format.atom { render :layout => false } 25 + format.atom { render layout: false }
26 end 26 end
27 end 27 end
28 28
@@ -61,9 +61,9 @@ class CommitsController &lt; ApplicationController @@ -61,9 +61,9 @@ class CommitsController &lt; ApplicationController
61 61
62 send_data( 62 send_data(
63 @commit.to_patch, 63 @commit.to_patch,
64 - :type => "text/plain",  
65 - :disposition => 'attachment',  
66 - :filename => (@commit.id.to_s + ".patch") 64 + type: "text/plain",
  65 + disposition: 'attachment',
  66 + filename: (@commit.id.to_s + ".patch")
67 ) 67 )
68 end 68 end
69 end 69 end
app/controllers/dashboard_controller.rb
@@ -9,7 +9,7 @@ class DashboardController &lt; ApplicationController @@ -9,7 +9,7 @@ class DashboardController &lt; ApplicationController
9 respond_to do |format| 9 respond_to do |format|
10 format.html 10 format.html
11 format.js 11 format.js
12 - format.atom { render :layout => false } 12 + format.atom { render layout: false }
13 end 13 end
14 end 14 end
15 15
@@ -28,7 +28,7 @@ class DashboardController &lt; ApplicationController @@ -28,7 +28,7 @@ class DashboardController &lt; ApplicationController
28 28
29 respond_to do |format| 29 respond_to do |format|
30 format.html 30 format.html
31 - format.atom { render :layout => false } 31 + format.atom { render layout: false }
32 end 32 end
33 end 33 end
34 end 34 end
app/controllers/deploy_keys_controller.rb
@@ -40,7 +40,7 @@ class DeployKeysController &lt; ApplicationController @@ -40,7 +40,7 @@ class DeployKeysController &lt; ApplicationController
40 40
41 respond_to do |format| 41 respond_to do |format|
42 format.html { redirect_to project_deploy_keys_url } 42 format.html { redirect_to project_deploy_keys_url }
43 - format.js { render :nothing => true } 43 + format.js { render nothing: true }
44 end 44 end
45 end 45 end
46 end 46 end
app/controllers/hooks_controller.rb
@@ -6,7 +6,7 @@ class HooksController &lt; ApplicationController @@ -6,7 +6,7 @@ class HooksController &lt; ApplicationController
6 # Authorize 6 # Authorize
7 before_filter :add_project_abilities 7 before_filter :add_project_abilities
8 before_filter :authorize_read_project! 8 before_filter :authorize_read_project!
9 - before_filter :authorize_admin_project!, :only => [:new, :create, :destroy] 9 + before_filter :authorize_admin_project!, only: [:new, :create, :destroy]
10 10
11 respond_to :html 11 respond_to :html
12 12
app/controllers/issues_controller.rb
@@ -2,7 +2,7 @@ class IssuesController &lt; ApplicationController @@ -2,7 +2,7 @@ class IssuesController &lt; ApplicationController
2 before_filter :authenticate_user! 2 before_filter :authenticate_user!
3 before_filter :project 3 before_filter :project
4 before_filter :module_enabled 4 before_filter :module_enabled
5 - before_filter :issue, :only => [:edit, :update, :destroy, :show] 5 + before_filter :issue, only: [:edit, :update, :destroy, :show]
6 helper_method :issues_filter 6 helper_method :issues_filter
7 7
8 layout "project" 8 layout "project"
@@ -14,13 +14,13 @@ class IssuesController &lt; ApplicationController @@ -14,13 +14,13 @@ class IssuesController &lt; ApplicationController
14 before_filter :authorize_read_issue! 14 before_filter :authorize_read_issue!
15 15
16 # Allow write(create) issue 16 # Allow write(create) issue
17 - before_filter :authorize_write_issue!, :only => [:new, :create] 17 + before_filter :authorize_write_issue!, only: [:new, :create]
18 18
19 # Allow modify issue 19 # Allow modify issue
20 - before_filter :authorize_modify_issue!, :only => [:close, :edit, :update] 20 + before_filter :authorize_modify_issue!, only: [:close, :edit, :update]
21 21
22 # Allow destroy issue 22 # Allow destroy issue
23 - before_filter :authorize_admin_issue!, :only => [:destroy] 23 + before_filter :authorize_admin_issue!, only: [:destroy]
24 24
25 respond_to :js, :html 25 respond_to :js, :html
26 26
@@ -32,7 +32,7 @@ class IssuesController &lt; ApplicationController @@ -32,7 +32,7 @@ class IssuesController &lt; ApplicationController
32 respond_to do |format| 32 respond_to do |format|
33 format.html # index.html.erb 33 format.html # index.html.erb
34 format.js 34 format.js
35 - format.atom { render :layout => false } 35 + format.atom { render layout: false }
36 end 36 end
37 end 37 end
38 38
@@ -46,7 +46,7 @@ class IssuesController &lt; ApplicationController @@ -46,7 +46,7 @@ class IssuesController &lt; ApplicationController
46 end 46 end
47 47
48 def show 48 def show
49 - @note = @project.notes.new(:noteable => @issue) 49 + @note = @project.notes.new(noteable: @issue)
50 50
51 respond_to do |format| 51 respond_to do |format|
52 format.html 52 format.html
@@ -66,7 +66,7 @@ class IssuesController &lt; ApplicationController @@ -66,7 +66,7 @@ class IssuesController &lt; ApplicationController
66 end 66 end
67 67
68 def update 68 def update
69 - @issue.update_attributes(params[:issue].merge(:author_id_of_changes => current_user.id)) 69 + @issue.update_attributes(params[:issue].merge(author_id_of_changes: current_user.id))
70 70
71 respond_to do |format| 71 respond_to do |format|
72 format.js 72 format.js
@@ -87,20 +87,20 @@ class IssuesController &lt; ApplicationController @@ -87,20 +87,20 @@ class IssuesController &lt; ApplicationController
87 87
88 respond_to do |format| 88 respond_to do |format|
89 format.html { redirect_to project_issues_path } 89 format.html { redirect_to project_issues_path }
90 - format.js { render :nothing => true } 90 + format.js { render nothing: true }
91 end 91 end
92 end 92 end
93 93
94 def sort 94 def sort
95 return render_404 unless can?(current_user, :admin_issue, @project) 95 return render_404 unless can?(current_user, :admin_issue, @project)
96 96
97 - @issues = @project.issues.where(:id => params['issue']) 97 + @issues = @project.issues.where(id: params['issue'])
98 @issues.each do |issue| 98 @issues.each do |issue|
99 issue.position = params['issue'].index(issue.id.to_s) + 1 99 issue.position = params['issue'].index(issue.id.to_s) + 1
100 issue.save 100 issue.save
101 end 101 end
102 102
103 - render :nothing => true 103 + render nothing: true
104 end 104 end
105 105
106 def search 106 def search
@@ -110,12 +110,12 @@ class IssuesController &lt; ApplicationController @@ -110,12 +110,12 @@ class IssuesController &lt; ApplicationController
110 @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank? 110 @issues = @issues.where("title LIKE ?", "%#{terms}%") unless terms.blank?
111 @issues = @issues.page(params[:page]).per(100) 111 @issues = @issues.page(params[:page]).per(100)
112 112
113 - render :partial => 'issues' 113 + render partial: 'issues'
114 end 114 end
115 115
116 def bulk_update 116 def bulk_update
117 result = IssuesBulkUpdateContext.new(project, current_user, params).execute 117 result = IssuesBulkUpdateContext.new(project, current_user, params).execute
118 - redirect_to :back, :notice => "#{result[:count]} issues updated" 118 + redirect_to :back, notice: "#{result[:count]} issues updated"
119 end 119 end
120 120
121 protected 121 protected
@@ -144,8 +144,8 @@ class IssuesController &lt; ApplicationController @@ -144,8 +144,8 @@ class IssuesController &lt; ApplicationController
144 else @project.issues.opened 144 else @project.issues.opened
145 end 145 end
146 146
147 - @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present?  
148 - @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present? 147 + @issues = @issues.where(assignee_id: params[:assignee_id]) if params[:assignee_id].present?
  148 + @issues = @issues.where(milestone_id: params[:milestone_id]) if params[:milestone_id].present?
149 @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present? 149 @issues = @issues.tagged_with(params[:label_name]) if params[:label_name].present?
150 @issues = @issues.includes(:author, :project).order("updated_at") 150 @issues = @issues.includes(:author, :project).order("updated_at")
151 @issues 151 @issues
app/controllers/keys_controller.rb
@@ -29,7 +29,7 @@ class KeysController &lt; ApplicationController @@ -29,7 +29,7 @@ class KeysController &lt; ApplicationController
29 29
30 respond_to do |format| 30 respond_to do |format|
31 format.html { redirect_to keys_url } 31 format.html { redirect_to keys_url }
32 - format.js { render :nothing => true } 32 + format.js { render nothing: true }
33 end 33 end
34 end 34 end
35 end 35 end
app/controllers/merge_requests_controller.rb
@@ -2,9 +2,9 @@ class MergeRequestsController &lt; ApplicationController @@ -2,9 +2,9 @@ class MergeRequestsController &lt; ApplicationController
2 before_filter :authenticate_user! 2 before_filter :authenticate_user!
3 before_filter :project 3 before_filter :project
4 before_filter :module_enabled 4 before_filter :module_enabled
5 - before_filter :merge_request, :only => [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]  
6 - before_filter :validates_merge_request, :only => [:show, :diffs, :raw]  
7 - before_filter :define_show_vars, :only => [:show, :diffs] 5 + before_filter :merge_request, only: [:edit, :update, :destroy, :show, :commits, :diffs, :automerge, :automerge_check, :raw]
  6 + before_filter :validates_merge_request, only: [:show, :diffs, :raw]
  7 + before_filter :define_show_vars, only: [:show, :diffs]
8 layout "project" 8 layout "project"
9 9
10 # Authorize 10 # Authorize
@@ -14,13 +14,13 @@ class MergeRequestsController &lt; ApplicationController @@ -14,13 +14,13 @@ class MergeRequestsController &lt; ApplicationController
14 before_filter :authorize_read_merge_request! 14 before_filter :authorize_read_merge_request!
15 15
16 # Allow write(create) merge_request 16 # Allow write(create) merge_request
17 - before_filter :authorize_write_merge_request!, :only => [:new, :create] 17 + before_filter :authorize_write_merge_request!, only: [:new, :create]
18 18
19 # Allow modify merge_request 19 # Allow modify merge_request
20 - before_filter :authorize_modify_merge_request!, :only => [:close, :edit, :update, :sort] 20 + before_filter :authorize_modify_merge_request!, only: [:close, :edit, :update, :sort]
21 21
22 # Allow destroy merge_request 22 # Allow destroy merge_request
23 - before_filter :authorize_admin_merge_request!, :only => [:destroy] 23 + before_filter :authorize_admin_merge_request!, only: [:destroy]
24 24
25 25
26 def index 26 def index
@@ -66,7 +66,7 @@ class MergeRequestsController &lt; ApplicationController @@ -66,7 +66,7 @@ class MergeRequestsController &lt; ApplicationController
66 end 66 end
67 67
68 def update 68 def update
69 - if @merge_request.update_attributes(params[:merge_request].merge(:author_id_of_changes => current_user.id)) 69 + if @merge_request.update_attributes(params[:merge_request].merge(author_id_of_changes: current_user.id))
70 @merge_request.reload_code 70 @merge_request.reload_code
71 @merge_request.mark_as_unchecked 71 @merge_request.mark_as_unchecked
72 redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.' 72 redirect_to [@project, @merge_request], notice: 'Merge request was successfully updated.'
@@ -79,7 +79,7 @@ class MergeRequestsController &lt; ApplicationController @@ -79,7 +79,7 @@ class MergeRequestsController &lt; ApplicationController
79 if @merge_request.unchecked? 79 if @merge_request.unchecked?
80 @merge_request.check_if_can_be_merged 80 @merge_request.check_if_can_be_merged
81 end 81 end
82 - render :json => {:state => @merge_request.human_state} 82 + render json: {state: @merge_request.human_state}
83 end 83 end
84 84
85 def automerge 85 def automerge
@@ -138,7 +138,7 @@ class MergeRequestsController &lt; ApplicationController @@ -138,7 +138,7 @@ class MergeRequestsController &lt; ApplicationController
138 138
139 def define_show_vars 139 def define_show_vars
140 # Build a note object for comment form 140 # Build a note object for comment form
141 - @note = @project.notes.new(:noteable => @merge_request) 141 + @note = @project.notes.new(noteable: @merge_request)
142 142
143 # Get commits from repository 143 # Get commits from repository
144 # or from cache if already merged 144 # or from cache if already merged
app/controllers/milestones_controller.rb
@@ -2,7 +2,7 @@ class MilestonesController &lt; ApplicationController @@ -2,7 +2,7 @@ class MilestonesController &lt; ApplicationController
2 before_filter :authenticate_user! 2 before_filter :authenticate_user!
3 before_filter :project 3 before_filter :project
4 before_filter :module_enabled 4 before_filter :module_enabled
5 - before_filter :milestone, :only => [:edit, :update, :destroy, :show] 5 + before_filter :milestone, only: [:edit, :update, :destroy, :show]
6 layout "project" 6 layout "project"
7 7
8 # Authorize 8 # Authorize
@@ -12,7 +12,7 @@ class MilestonesController &lt; ApplicationController @@ -12,7 +12,7 @@ class MilestonesController &lt; ApplicationController
12 before_filter :authorize_read_milestone! 12 before_filter :authorize_read_milestone!
13 13
14 # Allow admin milestone 14 # Allow admin milestone
15 - before_filter :authorize_admin_milestone!, :except => [:index, :show] 15 + before_filter :authorize_admin_milestone!, except: [:index, :show]
16 16
17 respond_to :html 17 respond_to :html
18 18
@@ -77,7 +77,7 @@ class MilestonesController &lt; ApplicationController @@ -77,7 +77,7 @@ class MilestonesController &lt; ApplicationController
77 77
78 respond_to do |format| 78 respond_to do |format|
79 format.html { redirect_to project_milestones_path } 79 format.html { redirect_to project_milestones_path }
80 - format.js { render :nothing => true } 80 + format.js { render nothing: true }
81 end 81 end
82 end 82 end
83 83
app/controllers/notes_controller.rb
@@ -5,7 +5,7 @@ class NotesController &lt; ApplicationController @@ -5,7 +5,7 @@ class NotesController &lt; ApplicationController
5 before_filter :add_project_abilities 5 before_filter :add_project_abilities
6 6
7 before_filter :authorize_read_note! 7 before_filter :authorize_read_note!
8 - before_filter :authorize_write_note!, :only => [:create] 8 + before_filter :authorize_write_note!, only: [:create]
9 9
10 respond_to :js 10 respond_to :js
11 11
@@ -29,12 +29,12 @@ class NotesController &lt; ApplicationController @@ -29,12 +29,12 @@ class NotesController &lt; ApplicationController
29 @note.destroy 29 @note.destroy
30 30
31 respond_to do |format| 31 respond_to do |format|
32 - format.js { render :nothing => true } 32 + format.js { render nothing: true }
33 end 33 end
34 end 34 end
35 35
36 def preview 36 def preview
37 - render :text => view_context.markdown(params[:note]) 37 + render text: view_context.markdown(params[:note])
38 end 38 end
39 39
40 protected 40 protected
app/controllers/profile_controller.rb
@@ -26,7 +26,7 @@ class ProfileController &lt; ApplicationController @@ -26,7 +26,7 @@ class ProfileController &lt; ApplicationController
26 flash[:notice] = "Password was successfully updated. Please login with it" 26 flash[:notice] = "Password was successfully updated. Please login with it"
27 redirect_to new_user_session_path 27 redirect_to new_user_session_path
28 else 28 else
29 - render :action => "password" 29 + render action: "password"
30 end 30 end
31 end 31 end
32 32
app/controllers/projects_controller.rb
1 require File.join(Rails.root, 'lib', 'graph_commit') 1 require File.join(Rails.root, 'lib', 'graph_commit')
2 2
3 class ProjectsController < ApplicationController 3 class ProjectsController < ApplicationController
4 - before_filter :project, :except => [:index, :new, :create] 4 + before_filter :project, except: [:index, :new, :create]
5 layout :determine_layout 5 layout :determine_layout
6 6
7 # Authorize 7 # Authorize
8 before_filter :add_project_abilities 8 before_filter :add_project_abilities
9 - before_filter :authorize_read_project!, :except => [:index, :new, :create]  
10 - before_filter :authorize_admin_project!, :only => [:edit, :update, :destroy]  
11 - before_filter :require_non_empty_project, :only => [:blob, :tree, :graph] 9 + before_filter :authorize_read_project!, except: [:index, :new, :create]
  10 + before_filter :authorize_admin_project!, only: [:edit, :update, :destroy]
  11 + before_filter :require_non_empty_project, only: [:blob, :tree, :graph]
12 12
13 def new 13 def new
14 @project = Project.new 14 @project = Project.new
@@ -35,7 +35,7 @@ class ProjectsController &lt; ApplicationController @@ -35,7 +35,7 @@ class ProjectsController &lt; ApplicationController
35 def update 35 def update
36 respond_to do |format| 36 respond_to do |format|
37 if project.update_attributes(params[:project]) 37 if project.update_attributes(params[:project])
38 - format.html { redirect_to edit_project_path(project), :notice => 'Project was successfully updated.' } 38 + format.html { redirect_to edit_project_path(project), notice: 'Project was successfully updated.' }
39 format.js 39 format.js
40 else 40 else
41 format.html { render action: "edit" } 41 format.html { render action: "edit" }
app/controllers/protected_branches_controller.rb
@@ -6,7 +6,7 @@ class ProtectedBranchesController &lt; ApplicationController @@ -6,7 +6,7 @@ class ProtectedBranchesController &lt; ApplicationController
6 before_filter :authorize_read_project! 6 before_filter :authorize_read_project!
7 before_filter :require_non_empty_project 7 before_filter :require_non_empty_project
8 8
9 - before_filter :authorize_admin_project!, :only => [:destroy, :create] 9 + before_filter :authorize_admin_project!, only: [:destroy, :create]
10 before_filter :render_full_content 10 before_filter :render_full_content
11 11
12 layout "project" 12 layout "project"
@@ -26,7 +26,7 @@ class ProtectedBranchesController &lt; ApplicationController @@ -26,7 +26,7 @@ class ProtectedBranchesController &lt; ApplicationController
26 26
27 respond_to do |format| 27 respond_to do |format|
28 format.html { redirect_to project_protected_branches_path } 28 format.html { redirect_to project_protected_branches_path }
29 - format.js { render :nothing => true } 29 + format.js { render nothing: true }
30 end 30 end
31 end 31 end
32 end 32 end
app/controllers/refs_controller.rb
@@ -9,7 +9,7 @@ class RefsController &lt; ApplicationController @@ -9,7 +9,7 @@ class RefsController &lt; ApplicationController
9 before_filter :require_non_empty_project 9 before_filter :require_non_empty_project
10 10
11 before_filter :ref 11 before_filter :ref
12 - before_filter :define_tree_vars, :only => [:tree, :blob, :blame, :logs_tree] 12 + before_filter :define_tree_vars, only: [:tree, :blob, :blame, :logs_tree]
13 before_filter :render_full_content 13 before_filter :render_full_content
14 14
15 layout "project" 15 layout "project"
@@ -20,7 +20,7 @@ class RefsController &lt; ApplicationController @@ -20,7 +20,7 @@ class RefsController &lt; ApplicationController
20 new_path = if params[:destination] == "tree" 20 new_path = if params[:destination] == "tree"
21 tree_project_ref_path(@project, params[:ref]) 21 tree_project_ref_path(@project, params[:ref])
22 else 22 else
23 - project_commits_path(@project, :ref => params[:ref]) 23 + project_commits_path(@project, ref: params[:ref])
24 end 24 end
25 25
26 redirect_to new_path 26 redirect_to new_path
@@ -53,8 +53,8 @@ class RefsController &lt; ApplicationController @@ -53,8 +53,8 @@ class RefsController &lt; ApplicationController
53 last_commit = @project.commits(@commit.id, file, 1).last 53 last_commit = @project.commits(@commit.id, file, 1).last
54 last_commit = CommitDecorator.decorate(last_commit) 54 last_commit = CommitDecorator.decorate(last_commit)
55 { 55 {
56 - :file_name => content.name,  
57 - :commit => last_commit 56 + file_name: content.name,
  57 + commit: last_commit
58 } 58 }
59 end 59 end
60 end 60 end
@@ -70,9 +70,9 @@ class RefsController &lt; ApplicationController @@ -70,9 +70,9 @@ class RefsController &lt; ApplicationController
70 70
71 send_data( 71 send_data(
72 @tree.data, 72 @tree.data,
73 - :type => mime_type,  
74 - :disposition => 'inline',  
75 - :filename => @tree.name 73 + type: mime_type,
  74 + disposition: 'inline',
  75 + filename: @tree.name
76 ) 76 )
77 else 77 else
78 head(404) 78 head(404)
app/controllers/search_controller.rb
@@ -8,8 +8,8 @@ class SearchController &lt; ApplicationController @@ -8,8 +8,8 @@ class SearchController &lt; ApplicationController
8 8
9 if query.present? 9 if query.present?
10 @projects = current_user.projects.search(query).limit(10) 10 @projects = current_user.projects.search(query).limit(10)
11 - @merge_requests = MergeRequest.where(:project_id => current_user.project_ids).search(query).limit(10)  
12 - @issues = Issue.where(:project_id => current_user.project_ids).search(query).limit(10) 11 + @merge_requests = MergeRequest.where(project_id: current_user.project_ids).search(query).limit(10)
  12 + @issues = Issue.where(project_id: current_user.project_ids).search(query).limit(10)
13 end 13 end
14 end 14 end
15 end 15 end
app/controllers/snippets_controller.rb
1 class SnippetsController < ApplicationController 1 class SnippetsController < ApplicationController
2 before_filter :authenticate_user! 2 before_filter :authenticate_user!
3 before_filter :project 3 before_filter :project
4 - before_filter :snippet, :only => [:show, :edit, :destroy, :update, :raw] 4 + before_filter :snippet, only: [:show, :edit, :destroy, :update, :raw]
5 layout "project" 5 layout "project"
6 6
7 # Authorize 7 # Authorize
@@ -11,13 +11,13 @@ class SnippetsController &lt; ApplicationController @@ -11,13 +11,13 @@ class SnippetsController &lt; ApplicationController
11 before_filter :authorize_read_snippet! 11 before_filter :authorize_read_snippet!
12 12
13 # Allow write(create) snippet 13 # Allow write(create) snippet
14 - before_filter :authorize_write_snippet!, :only => [:new, :create] 14 + before_filter :authorize_write_snippet!, only: [:new, :create]
15 15
16 # Allow modify snippet 16 # Allow modify snippet
17 - before_filter :authorize_modify_snippet!, :only => [:edit, :update] 17 + before_filter :authorize_modify_snippet!, only: [:edit, :update]
18 18
19 # Allow destroy snippet 19 # Allow destroy snippet
20 - before_filter :authorize_admin_snippet!, :only => [:destroy] 20 + before_filter :authorize_admin_snippet!, only: [:destroy]
21 21
22 respond_to :html 22 respond_to :html
23 23
@@ -55,7 +55,7 @@ class SnippetsController &lt; ApplicationController @@ -55,7 +55,7 @@ class SnippetsController &lt; ApplicationController
55 end 55 end
56 56
57 def show 57 def show
58 - @note = @project.notes.new(:noteable => @snippet) 58 + @note = @project.notes.new(noteable: @snippet)
59 render_full_content 59 render_full_content
60 end 60 end
61 61
@@ -70,9 +70,9 @@ class SnippetsController &lt; ApplicationController @@ -70,9 +70,9 @@ class SnippetsController &lt; ApplicationController
70 def raw 70 def raw
71 send_data( 71 send_data(
72 @snippet.content, 72 @snippet.content,
73 - :type => "text/plain",  
74 - :disposition => 'inline',  
75 - :filename => @snippet.file_name 73 + type: "text/plain",
  74 + disposition: 'inline',
  75 + filename: @snippet.file_name
76 ) 76 )
77 end 77 end
78 78
app/controllers/team_members_controller.rb
@@ -5,7 +5,7 @@ class TeamMembersController &lt; ApplicationController @@ -5,7 +5,7 @@ class TeamMembersController &lt; ApplicationController
5 # Authorize 5 # Authorize
6 before_filter :add_project_abilities 6 before_filter :add_project_abilities
7 before_filter :authorize_read_project! 7 before_filter :authorize_read_project!
8 - before_filter :authorize_admin_project!, :except => [:show] 8 + before_filter :authorize_admin_project!, except: [:show]
9 9
10 def show 10 def show
11 @team_member = project.users_projects.find(params[:id]) 11 @team_member = project.users_projects.find(params[:id])
@@ -41,7 +41,7 @@ class TeamMembersController &lt; ApplicationController @@ -41,7 +41,7 @@ class TeamMembersController &lt; ApplicationController
41 41
42 respond_to do |format| 42 respond_to do |format|
43 format.html { redirect_to team_project_path(@project) } 43 format.html { redirect_to team_project_path(@project) }
44 - format.js { render :nothing => true } 44 + format.js { render nothing: true }
45 end 45 end
46 end 46 end
47 end 47 end
app/controllers/wikis_controller.rb
@@ -2,8 +2,8 @@ class WikisController &lt; ApplicationController @@ -2,8 +2,8 @@ class WikisController &lt; ApplicationController
2 before_filter :project 2 before_filter :project
3 before_filter :add_project_abilities 3 before_filter :add_project_abilities
4 before_filter :authorize_read_wiki! 4 before_filter :authorize_read_wiki!
5 - before_filter :authorize_write_wiki!, :only => [:edit, :create, :history]  
6 - before_filter :authorize_admin_wiki!, :only => :destroy 5 + before_filter :authorize_write_wiki!, only: [:edit, :create, :history]
  6 + before_filter :authorize_admin_wiki!, only: :destroy
7 layout "project" 7 layout "project"
8 8
9 def pages 9 def pages
@@ -14,16 +14,16 @@ class WikisController &lt; ApplicationController @@ -14,16 +14,16 @@ class WikisController &lt; ApplicationController
14 if params[:old_page_id] 14 if params[:old_page_id]
15 @wiki = @project.wikis.find(params[:old_page_id]) 15 @wiki = @project.wikis.find(params[:old_page_id])
16 else 16 else
17 - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last 17 + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
18 end 18 end
19 19
20 - @note = @project.notes.new(:noteable => @wiki) 20 + @note = @project.notes.new(noteable: @wiki)
21 21
22 if @wiki 22 if @wiki
23 render 'show' 23 render 'show'
24 else 24 else
25 if can?(current_user, :write_wiki, @project) 25 if can?(current_user, :write_wiki, @project)
26 - @wiki = @project.wikis.new(:slug => params[:id]) 26 + @wiki = @project.wikis.new(slug: params[:id])
27 render 'edit' 27 render 'edit'
28 else 28 else
29 render 'empty' 29 render 'empty'
@@ -32,7 +32,7 @@ class WikisController &lt; ApplicationController @@ -32,7 +32,7 @@ class WikisController &lt; ApplicationController
32 end 32 end
33 33
34 def edit 34 def edit
35 - @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last 35 + @wiki = @project.wikis.where(slug: params[:id]).order("created_at").last
36 @wiki = Wiki.regenerate_from @wiki 36 @wiki = Wiki.regenerate_from @wiki
37 end 37 end
38 38
@@ -50,11 +50,11 @@ class WikisController &lt; ApplicationController @@ -50,11 +50,11 @@ class WikisController &lt; ApplicationController
50 end 50 end
51 51
52 def history 52 def history
53 - @wikis = @project.wikis.where(:slug => params[:id]).order("created_at") 53 + @wikis = @project.wikis.where(slug: params[:id]).order("created_at")
54 end 54 end
55 55
56 def destroy 56 def destroy
57 - @wikis = @project.wikis.where(:slug => params[:id]).delete_all 57 + @wikis = @project.wikis.where(slug: params[:id]).delete_all
58 58
59 respond_to do |format| 59 respond_to do |format|
60 format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" } 60 format.html { redirect_to project_wiki_path(@project, :index), notice: "Page was successfully deleted" }
app/decorators/application_decorator.rb
@@ -15,7 +15,7 @@ class ApplicationDecorator &lt; Drapper::Base @@ -15,7 +15,7 @@ class ApplicationDecorator &lt; Drapper::Base
15 # 15 #
16 # def formatted_timestamp(time) 16 # def formatted_timestamp(time)
17 # h.content_tag :span, time.strftime("%a %m/%d/%y"), 17 # h.content_tag :span, time.strftime("%a %m/%d/%y"),
18 - # :class => 'timestamp' 18 + # class: 'timestamp'
19 # end 19 # end
20 # 20 #
21 # def created_at 21 # def created_at
app/decorators/event_decorator.rb
@@ -19,7 +19,7 @@ class EventDecorator &lt; ApplicationDecorator @@ -19,7 +19,7 @@ class EventDecorator &lt; ApplicationDecorator
19 elsif self.merge_request? 19 elsif self.merge_request?
20 h.project_merge_request_url(self.project, self.merge_request) 20 h.project_merge_request_url(self.project, self.merge_request)
21 elsif self.push? 21 elsif self.push?
22 - h.project_commits_url(self.project, :ref => self.ref_name) 22 + h.project_commits_url(self.project, ref: self.ref_name)
23 end 23 end
24 end 24 end
25 end 25 end
app/decorators/tree_decorator.rb
@@ -8,14 +8,14 @@ class TreeDecorator &lt; ApplicationDecorator @@ -8,14 +8,14 @@ class TreeDecorator &lt; ApplicationDecorator
8 8
9 #parts = parts[0...-1] if is_blob? 9 #parts = parts[0...-1] if is_blob?
10 10
11 - yield(h.link_to("..", "#", :remote => :true)) if parts.count > max_links 11 + yield(h.link_to("..", "#", remote: :true)) if parts.count > max_links
12 12
13 parts.each do |part| 13 parts.each do |part|
14 part_path = File.join(part_path, part) unless part_path.empty? 14 part_path = File.join(part_path, part) unless part_path.empty?
15 part_path = part if part_path.empty? 15 part_path = part if part_path.empty?
16 16
17 next unless parts.last(2).include?(part) if parts.count > max_links 17 next unless parts.last(2).include?(part) if parts.count > max_links
18 - yield(h.link_to(h.truncate(part, :length => 40), h.tree_file_project_ref_path(project, ref, :path => part_path), :remote => :true)) 18 + yield(h.link_to(h.truncate(part, length: 40), h.tree_file_project_ref_path(project, ref, path: part_path), remote: :true))
19 end 19 end
20 end 20 end
21 end 21 end
@@ -30,7 +30,7 @@ class TreeDecorator &lt; ApplicationDecorator @@ -30,7 +30,7 @@ class TreeDecorator &lt; ApplicationDecorator
30 end 30 end
31 31
32 def history_path 32 def history_path
33 - h.project_commits_path(project, :path => path, :ref => ref) 33 + h.project_commits_path(project, path: path, ref: ref)
34 end 34 end
35 35
36 def mb_size 36 def mb_size
app/helpers/application_helper.rb
@@ -43,23 +43,23 @@ module ApplicationHelper @@ -43,23 +43,23 @@ module ApplicationHelper
43 end 43 end
44 44
45 def search_autocomplete_source 45 def search_autocomplete_source
46 - projects = current_user.projects.map{ |p| { :label => p.name, :url => project_path(p) } } 46 + projects = current_user.projects.map{ |p| { label: p.name, url: project_path(p) } }
47 default_nav = [ 47 default_nav = [
48 - { :label => "Profile", :url => profile_path },  
49 - { :label => "Keys", :url => keys_path },  
50 - { :label => "Dashboard", :url => root_path },  
51 - { :label => "Admin", :url => admin_root_path } 48 + { label: "Profile", url: profile_path },
  49 + { label: "Keys", url: keys_path },
  50 + { label: "Dashboard", url: root_path },
  51 + { label: "Admin", url: admin_root_path }
52 ] 52 ]
53 53
54 project_nav = [] 54 project_nav = []
55 55
56 if @project && !@project.new_record? 56 if @project && !@project.new_record?
57 project_nav = [ 57 project_nav = [
58 - { :label => "#{@project.name} / Issues", :url => project_issues_path(@project) },  
59 - { :label => "#{@project.name} / Wall", :url => wall_project_path(@project) },  
60 - { :label => "#{@project.name} / Tree", :url => tree_project_ref_path(@project, @project.root_ref) },  
61 - { :label => "#{@project.name} / Commits", :url => project_commits_path(@project) },  
62 - { :label => "#{@project.name} / Team", :url => team_project_path(@project) } 58 + { label: "#{@project.name} / Issues", url: project_issues_path(@project) },
  59 + { label: "#{@project.name} / Wall", url: wall_project_path(@project) },
  60 + { label: "#{@project.name} / Tree", url: tree_project_ref_path(@project, @project.root_ref) },
  61 + { label: "#{@project.name} / Commits", url: project_commits_path(@project) },
  62 + { label: "#{@project.name} / Team", url: team_project_path(@project) }
63 ] 63 ]
64 end 64 end
65 65
@@ -89,7 +89,7 @@ module ApplicationHelper @@ -89,7 +89,7 @@ module ApplicationHelper
89 when :wall; wall_tab? 89 when :wall; wall_tab?
90 when :wiki; controller.controller_name == "wikis" 90 when :wiki; controller.controller_name == "wikis"
91 when :issues; issues_tab? 91 when :issues; issues_tab?
92 - when :network; current_page?(:controller => "projects", :action => "graph", :id => @project) 92 + when :network; current_page?(controller: "projects", action: "graph", id: @project)
93 when :merge_requests; controller.controller_name == "merge_requests" 93 when :merge_requests; controller.controller_name == "merge_requests"
94 94
95 # Dashboard Area 95 # Dashboard Area
@@ -100,10 +100,10 @@ module ApplicationHelper @@ -100,10 +100,10 @@ module ApplicationHelper
100 when :root; current_page?(dashboard_path) || current_page?(root_path) 100 when :root; current_page?(dashboard_path) || current_page?(root_path)
101 101
102 # Profile Area 102 # Profile Area
103 - when :profile; current_page?(:controller => "profile", :action => :show)  
104 - when :password; current_page?(:controller => "profile", :action => :password)  
105 - when :token; current_page?(:controller => "profile", :action => :token)  
106 - when :design; current_page?(:controller => "profile", :action => :design) 103 + when :profile; current_page?(controller: "profile", action: :show)
  104 + when :password; current_page?(controller: "profile", action: :password)
  105 + when :token; current_page?(controller: "profile", action: :token)
  106 + when :design; current_page?(controller: "profile", action: :design)
107 when :ssh_keys; controller.controller_name == "keys" 107 when :ssh_keys; controller.controller_name == "keys"
108 108
109 # Admin Area 109 # Admin Area
app/helpers/gitlab_markdown_helper.rb
@@ -28,32 +28,32 @@ module GitlabMarkdownHelper @@ -28,32 +28,32 @@ module GitlabMarkdownHelper
28 28
29 # team member: @foo 29 # team member: @foo
30 when /^@/ 30 when /^@/
31 - user = @project.users.where(:name => user_name).first  
32 - member = @project.users_projects.where(:user_id => user).first if user  
33 - link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(:class => "gfm gfm-team_member #{html_options[:class]}")) if member 31 + user = @project.users.where(name: user_name).first
  32 + member = @project.users_projects.where(user_id: user).first if user
  33 + link_to("@#{user_name}", project_team_member_path(@project, member), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member
34 34
35 # issue: #123 35 # issue: #123
36 when /^#/ 36 when /^#/
37 # avoid HTML entities 37 # avoid HTML entities
38 unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";") 38 unless prefix.try(:end_with?, "&") && suffix.try(:start_with?, ";")
39 - issue = @project.issues.where(:id => issue_id).first  
40 - link_to("##{issue_id}", project_issue_path(@project, issue), html_options.merge(:title => "Issue: #{issue.title}", :class => "gfm gfm-issue #{html_options[:class]}")) if issue 39 + issue = @project.issues.where(id: issue_id).first
  40 + link_to("##{issue_id}", project_issue_path(@project, issue), html_options.merge(title: "Issue: #{issue.title}", class: "gfm gfm-issue #{html_options[:class]}")) if issue
41 end 41 end
42 42
43 # merge request: !123 43 # merge request: !123
44 when /^!/ 44 when /^!/
45 - merge_request = @project.merge_requests.where(:id => merge_request_id).first  
46 - link_to("!#{merge_request_id}", project_merge_request_path(@project, merge_request), html_options.merge(:title => "Merge Request: #{merge_request.title}", :class => "gfm gfm-merge_request #{html_options[:class]}")) if merge_request 45 + merge_request = @project.merge_requests.where(id: merge_request_id).first
  46 + link_to("!#{merge_request_id}", project_merge_request_path(@project, merge_request), html_options.merge(title: "Merge Request: #{merge_request.title}", class: "gfm gfm-merge_request #{html_options[:class]}")) if merge_request
47 47
48 # snippet: $123 48 # snippet: $123
49 when /^\$/ 49 when /^\$/
50 - snippet = @project.snippets.where(:id => snippet_id).first  
51 - link_to("$#{snippet_id}", project_snippet_path(@project, snippet), html_options.merge(:title => "Snippet: #{snippet.title}", :class => "gfm gfm-snippet #{html_options[:class]}")) if snippet 50 + snippet = @project.snippets.where(id: snippet_id).first
  51 + link_to("$#{snippet_id}", project_snippet_path(@project, snippet), html_options.merge(title: "Snippet: #{snippet.title}", class: "gfm gfm-snippet #{html_options[:class]}")) if snippet
52 52
53 # commit: 123456... 53 # commit: 123456...
54 when /^\h/ 54 when /^\h/
55 commit = @project.commit(commit_id) 55 commit = @project.commit(commit_id)
56 - link_to(commit_id, project_commit_path(@project, :id => commit.id), html_options.merge(:title => "Commit: #{commit.author_name} - #{CommitDecorator.new(commit).title}", :class => "gfm gfm-commit #{html_options[:class]}")) if commit 56 + link_to(commit_id, project_commit_path(@project, id: commit.id), html_options.merge(title: "Commit: #{commit.author_name} - #{CommitDecorator.new(commit).title}", class: "gfm gfm-commit #{html_options[:class]}")) if commit
57 57
58 end # case 58 end # case
59 59
app/helpers/issues_helper.rb
@@ -9,7 +9,7 @@ module IssuesHelper @@ -9,7 +9,7 @@ module IssuesHelper
9 9
10 tm = project.team_member_by_id(issue.assignee_id) 10 tm = project.team_member_by_id(issue.assignee_id)
11 if tm 11 if tm
12 - link_to issue.assignee_name, project_team_member_path(project, tm), :class => "author_link" 12 + link_to issue.assignee_name, project_team_member_path(project, tm), class: "author_link"
13 else 13 else
14 issue.assignee_name 14 issue.assignee_name
15 end 15 end
@@ -20,7 +20,7 @@ module IssuesHelper @@ -20,7 +20,7 @@ module IssuesHelper
20 20
21 tm = project.team_member_by_id(issue.author_id) 21 tm = project.team_member_by_id(issue.author_id)
22 if tm 22 if tm
23 - link_to issue.author_name, project_team_member_path(project, tm), :class => "author_link" 23 + link_to issue.author_name, project_team_member_path(project, tm), class: "author_link"
24 else 24 else
25 issue.author_name 25 issue.author_name
26 end 26 end
app/helpers/merge_requests_helper.rb
@@ -4,7 +4,7 @@ module MergeRequestsHelper @@ -4,7 +4,7 @@ module MergeRequestsHelper
4 4
5 tm = project.team_member_by_id(merge_request.assignee_id) 5 tm = project.team_member_by_id(merge_request.assignee_id)
6 if tm 6 if tm
7 - link_to merge_request.assignee_name, project_team_member_path(project, tm), :class => "author_link" 7 + link_to merge_request.assignee_name, project_team_member_path(project, tm), class: "author_link"
8 else 8 else
9 merge_request.assignee_name 9 merge_request.assignee_name
10 end 10 end
@@ -15,7 +15,7 @@ module MergeRequestsHelper @@ -15,7 +15,7 @@ module MergeRequestsHelper
15 15
16 tm = project.team_member_by_id(merge_request.author_id) 16 tm = project.team_member_by_id(merge_request.author_id)
17 if tm 17 if tm
18 - link_to merge_request.author_name, project_team_member_path(project, tm), :class => "author_link" 18 + link_to merge_request.author_name, project_team_member_path(project, tm), class: "author_link"
19 else 19 else
20 merge_request.author_name 20 merge_request.author_name
21 end 21 end
@@ -24,10 +24,10 @@ module MergeRequestsHelper @@ -24,10 +24,10 @@ module MergeRequestsHelper
24 def new_mr_path_from_push_event(event) 24 def new_mr_path_from_push_event(event)
25 new_project_merge_request_path( 25 new_project_merge_request_path(
26 event.project, 26 event.project,
27 - :merge_request => {  
28 - :source_branch => event.branch_name,  
29 - :target_branch => event.project.root_ref,  
30 - :title => event.branch_name.titleize 27 + merge_request: {
  28 + source_branch: event.branch_name,
  29 + target_branch: event.project.root_ref,
  30 + title: event.branch_name.titleize
31 } 31 }
32 ) 32 )
33 end 33 end
app/helpers/tab_helper.rb
@@ -4,12 +4,12 @@ module TabHelper @@ -4,12 +4,12 @@ module TabHelper
4 end 4 end
5 5
6 def wall_tab? 6 def wall_tab?
7 - current_page?(:controller => "projects", :action => "wall", :id => @project) 7 + current_page?(controller: "projects", action: "wall", id: @project)
8 end 8 end
9 9
10 def project_tab_class 10 def project_tab_class
11 [:show, :files, :team, :edit, :update].each do |action| 11 [:show, :files, :team, :edit, :update].each do |action|
12 - return "current" if current_page?(:controller => "projects", :action => action, :id => @project) 12 + return "current" if current_page?(controller: "projects", action: action, id: @project)
13 end 13 end
14 14
15 if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name 15 if ['snippets', 'hooks', 'deploy_keys', 'team_members'].include? controller.controller_name
app/mailers/notify.rb
@@ -12,20 +12,20 @@ class Notify &lt; ActionMailer::Base @@ -12,20 +12,20 @@ class Notify &lt; ActionMailer::Base
12 def new_user_email(user_id, password) 12 def new_user_email(user_id, password)
13 @user = User.find(user_id) 13 @user = User.find(user_id)
14 @password = password 14 @password = password
15 - mail(:to => @user.email, :subject => "gitlab | Account was created for you") 15 + mail(to: @user.email, subject: "gitlab | Account was created for you")
16 end 16 end
17 17
18 def new_issue_email(issue_id) 18 def new_issue_email(issue_id)
19 @issue = Issue.find(issue_id) 19 @issue = Issue.find(issue_id)
20 @project = @issue.project 20 @project = @issue.project
21 - mail(:to => @issue.assignee_email, :subject => "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}") 21 + mail(to: @issue.assignee_email, subject: "gitlab | new issue ##{@issue.id} | #{@issue.title} | #{@project.name}")
22 end 22 end
23 23
24 def note_wall_email(recipient_id, note_id) 24 def note_wall_email(recipient_id, note_id)
25 recipient = User.find(recipient_id) 25 recipient = User.find(recipient_id)
26 @note = Note.find(note_id) 26 @note = Note.find(note_id)
27 @project = @note.project 27 @project = @note.project
28 - mail(:to => recipient.email, :subject => "gitlab | #{@project.name}") 28 + mail(to: recipient.email, subject: "gitlab | #{@project.name}")
29 end 29 end
30 30
31 def note_commit_email(recipient_id, note_id) 31 def note_commit_email(recipient_id, note_id)
@@ -34,7 +34,7 @@ class Notify &lt; ActionMailer::Base @@ -34,7 +34,7 @@ class Notify &lt; ActionMailer::Base
34 @commit = @note.target 34 @commit = @note.target
35 @commit = CommitDecorator.decorate(@commit) 35 @commit = CommitDecorator.decorate(@commit)
36 @project = @note.project 36 @project = @note.project
37 - mail(:to => recipient.email, :subject => "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}") 37 + mail(to: recipient.email, subject: "gitlab | note for commit #{@commit.short_id} | #{@commit.title} | #{@project.name}")
38 end 38 end
39 39
40 def note_merge_request_email(recipient_id, note_id) 40 def note_merge_request_email(recipient_id, note_id)
@@ -42,7 +42,7 @@ class Notify &lt; ActionMailer::Base @@ -42,7 +42,7 @@ class Notify &lt; ActionMailer::Base
42 @note = Note.find(note_id) 42 @note = Note.find(note_id)
43 @merge_request = @note.noteable 43 @merge_request = @note.noteable
44 @project = @note.project 44 @project = @note.project
45 - mail(:to => recipient.email, :subject => "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}") 45 + mail(to: recipient.email, subject: "gitlab | note for merge request !#{@merge_request.id} | #{@project.name}")
46 end 46 end
47 47
48 def note_issue_email(recipient_id, note_id) 48 def note_issue_email(recipient_id, note_id)
@@ -50,7 +50,7 @@ class Notify &lt; ActionMailer::Base @@ -50,7 +50,7 @@ class Notify &lt; ActionMailer::Base
50 @note = Note.find(note_id) 50 @note = Note.find(note_id)
51 @issue = @note.noteable 51 @issue = @note.noteable
52 @project = @note.project 52 @project = @note.project
53 - mail(:to => recipient.email, :subject => "gitlab | note for issue ##{@issue.id} | #{@project.name}") 53 + mail(to: recipient.email, subject: "gitlab | note for issue ##{@issue.id} | #{@project.name}")
54 end 54 end
55 55
56 def note_wiki_email(recipient_id, note_id) 56 def note_wiki_email(recipient_id, note_id)
@@ -58,13 +58,13 @@ class Notify &lt; ActionMailer::Base @@ -58,13 +58,13 @@ class Notify &lt; ActionMailer::Base
58 @note = Note.find(note_id) 58 @note = Note.find(note_id)
59 @wiki = @note.noteable 59 @wiki = @note.noteable
60 @project = @note.project 60 @project = @note.project
61 - mail(:to => recipient.email, :subject => "gitlab | note for wiki | #{@project.name}") 61 + mail(to: recipient.email, subject: "gitlab | note for wiki | #{@project.name}")
62 end 62 end
63 63
64 def new_merge_request_email(merge_request_id) 64 def new_merge_request_email(merge_request_id)
65 @merge_request = MergeRequest.find(merge_request_id) 65 @merge_request = MergeRequest.find(merge_request_id)
66 @project = @merge_request.project 66 @project = @merge_request.project
67 - mail(:to => @merge_request.assignee_email, :subject => "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") 67 + mail(to: @merge_request.assignee_email, subject: "gitlab | new merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}")
68 end 68 end
69 69
70 def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) 70 def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
@@ -72,7 +72,7 @@ class Notify &lt; ActionMailer::Base @@ -72,7 +72,7 @@ class Notify &lt; ActionMailer::Base
72 @merge_request = MergeRequest.find(merge_request_id) 72 @merge_request = MergeRequest.find(merge_request_id)
73 @previous_assignee ||= User.find(previous_assignee_id) 73 @previous_assignee ||= User.find(previous_assignee_id)
74 @project = @merge_request.project 74 @project = @merge_request.project
75 - mail(:to => recipient.email, :subject => "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}") 75 + mail(to: recipient.email, subject: "gitlab | changed merge request !#{@merge_request.id} | #{@merge_request.title} | #{@project.name}")
76 end 76 end
77 77
78 def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) 78 def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
@@ -80,6 +80,6 @@ class Notify &lt; ActionMailer::Base @@ -80,6 +80,6 @@ class Notify &lt; ActionMailer::Base
80 @issue = Issue.find(issue_id) 80 @issue = Issue.find(issue_id)
81 @previous_assignee ||= User.find(previous_assignee_id) 81 @previous_assignee ||= User.find(previous_assignee_id)
82 @project = @issue.project 82 @project = @issue.project
83 - mail(:to => recipient.email, :subject => "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}") 83 + mail(to: recipient.email, subject: "gitlab | changed issue ##{@issue.id} | #{@issue.title} | #{@project.name}")
84 end 84 end
85 end 85 end
app/models/commit.rb
@@ -20,7 +20,7 @@ class Commit @@ -20,7 +20,7 @@ class Commit
20 :tree, 20 :tree,
21 :id, 21 :id,
22 :to_patch, 22 :to_patch,
23 - :to => :commit 23 + to: :commit
24 24
25 25
26 class << self 26 class << self
@@ -57,7 +57,7 @@ class Commit @@ -57,7 +57,7 @@ class Commit
57 57
58 def commits_since(repo, date) 58 def commits_since(repo, date)
59 commits = repo.heads.map do |h| 59 commits = repo.heads.map do |h|
60 - repo.log(h.name, nil, :since => date).each { |c| Commit.new(c, h) } 60 + repo.log(h.name, nil, since: date).each { |c| Commit.new(c, h) }
61 end.flatten.uniq { |c| c.id } 61 end.flatten.uniq { |c| c.id }
62 62
63 commits.sort! do |x, y| 63 commits.sort! do |x, y|
@@ -69,7 +69,7 @@ class Commit @@ -69,7 +69,7 @@ class Commit
69 69
70 def commits(repo, ref, path = nil, limit = nil, offset = nil) 70 def commits(repo, ref, path = nil, limit = nil, offset = nil)
71 if path 71 if path
72 - repo.log(ref, path, :max_count => limit, :skip => offset) 72 + repo.log(ref, path, max_count: limit, skip: offset)
73 elsif limit && offset 73 elsif limit && offset
74 repo.commits(ref, limit, offset) 74 repo.commits(ref, limit, offset)
75 else 75 else
@@ -86,9 +86,9 @@ class Commit @@ -86,9 +86,9 @@ class Commit
86 last = project.commit(from.try(:strip)) 86 last = project.commit(from.try(:strip))
87 87
88 result = { 88 result = {
89 - :commits => [],  
90 - :diffs => [],  
91 - :commit => nil 89 + commits: [],
  90 + diffs: [],
  91 + commit: nil
92 } 92 }
93 93
94 if first && last 94 if first && last
app/models/event.rb
@@ -12,13 +12,13 @@ class Event &lt; ActiveRecord::Base @@ -12,13 +12,13 @@ class Event &lt; ActiveRecord::Base
12 Merged = 7 12 Merged = 7
13 13
14 belongs_to :project 14 belongs_to :project
15 - belongs_to :target, :polymorphic => true 15 + belongs_to :target, polymorphic: true
16 16
17 # For Hash only 17 # For Hash only
18 serialize :data 18 serialize :data
19 19
20 scope :recent, order("created_at DESC") 20 scope :recent, order("created_at DESC")
21 - scope :code_push, where(:action => Pushed) 21 + scope :code_push, where(action: Pushed)
22 22
23 def self.determine_action(record) 23 def self.determine_action(record)
24 if [Issue, MergeRequest].include? record.class 24 if [Issue, MergeRequest].include? record.class
@@ -29,7 +29,7 @@ class Event &lt; ActiveRecord::Base @@ -29,7 +29,7 @@ class Event &lt; ActiveRecord::Base
29 end 29 end
30 30
31 def self.recent_for_user user 31 def self.recent_for_user user
32 - where(:project_id => user.projects.map(&:id)).recent 32 + where(project_id: user.projects.map(&:id)).recent
33 end 33 end
34 34
35 # Next events currently enabled for system 35 # Next events currently enabled for system
@@ -106,9 +106,9 @@ class Event &lt; ActiveRecord::Base @@ -106,9 +106,9 @@ class Event &lt; ActiveRecord::Base
106 end 106 end
107 end 107 end
108 108
109 - delegate :name, :email, :to => :author, :prefix => true, :allow_nil => true  
110 - delegate :title, :to => :issue, :prefix => true, :allow_nil => true  
111 - delegate :title, :to => :merge_request, :prefix => true, :allow_nil => true 109 + delegate :name, :email, to: :author, prefix: true, allow_nil: true
  110 + delegate :title, to: :issue, prefix: true, allow_nil: true
  111 + delegate :title, to: :merge_request, prefix: true, allow_nil: true
112 end 112 end
113 # == Schema Information 113 # == Schema Information
114 # 114 #
app/models/issue.rb
@@ -7,7 +7,7 @@ class Issue &lt; ActiveRecord::Base @@ -7,7 +7,7 @@ class Issue &lt; ActiveRecord::Base
7 belongs_to :milestone 7 belongs_to :milestone
8 8
9 validates :description, 9 validates :description,
10 - :length => { :within => 0..2000 } 10 + length: { within: 0..2000 }
11 11
12 acts_as_list 12 acts_as_list
13 13
app/models/key.rb
@@ -6,16 +6,16 @@ class Key &lt; ActiveRecord::Base @@ -6,16 +6,16 @@ class Key &lt; ActiveRecord::Base
6 belongs_to :project 6 belongs_to :project
7 7
8 validates :title, 8 validates :title,
9 - :presence => true,  
10 - :length => { :within => 0..255 } 9 + presence: true,
  10 + length: { within: 0..255 }
11 11
12 validates :key, 12 validates :key,
13 - :presence => true,  
14 - :length => { :within => 0..5000 } 13 + presence: true,
  14 + length: { within: 0..5000 }
15 15
16 before_save :set_identifier 16 before_save :set_identifier
17 before_validation :strip_white_space 17 before_validation :strip_white_space
18 - delegate :name, :email, :to => :user, :prefix => true 18 + delegate :name, :email, to: :user, prefix: true
19 validate :unique_key 19 validate :unique_key
20 20
21 def strip_white_space 21 def strip_white_space
@@ -23,7 +23,7 @@ class Key &lt; ActiveRecord::Base @@ -23,7 +23,7 @@ class Key &lt; ActiveRecord::Base
23 end 23 end
24 24
25 def unique_key 25 def unique_key
26 - query = Key.where(:key => key) 26 + query = Key.where(key: key)
27 query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id 27 query = query.where('(project_id IS NULL OR project_id = ?)', project_id) if project_id
28 if (query.count > 0) 28 if (query.count > 0)
29 errors.add :key, 'already exist.' 29 errors.add :key, 'already exist.'
app/models/merge_request.rb
@@ -20,7 +20,7 @@ class MergeRequest &lt; ActiveRecord::Base @@ -20,7 +20,7 @@ class MergeRequest &lt; ActiveRecord::Base
20 validate :validate_branches 20 validate :validate_branches
21 21
22 def self.find_all_by_branch(branch_name) 22 def self.find_all_by_branch(branch_name)
23 - where("source_branch like :branch or target_branch like :branch", :branch => branch_name) 23 + where("source_branch like :branch or target_branch like :branch", branch: branch_name)
24 end 24 end
25 25
26 def human_state 26 def human_state
@@ -48,7 +48,7 @@ class MergeRequest &lt; ActiveRecord::Base @@ -48,7 +48,7 @@ class MergeRequest &lt; ActiveRecord::Base
48 end 48 end
49 49
50 def mark_as_unchecked 50 def mark_as_unchecked
51 - self.update_attributes(:state => UNCHECKED) 51 + self.update_attributes(state: UNCHECKED)
52 end 52 end
53 53
54 def can_be_merged? 54 def can_be_merged?
@@ -101,11 +101,11 @@ class MergeRequest &lt; ActiveRecord::Base @@ -101,11 +101,11 @@ class MergeRequest &lt; ActiveRecord::Base
101 end 101 end
102 102
103 def merge_event 103 def merge_event
104 - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Merged).last 104 + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Merged).last
105 end 105 end
106 106
107 def closed_event 107 def closed_event
108 - self.project.events.where(:target_id => self.id, :target_type => "MergeRequest", :action => Event::Closed).last 108 + self.project.events.where(target_id: self.id, target_type: "MergeRequest", action: Event::Closed).last
109 end 109 end
110 110
111 def commits 111 def commits
@@ -128,7 +128,7 @@ class MergeRequest &lt; ActiveRecord::Base @@ -128,7 +128,7 @@ class MergeRequest &lt; ActiveRecord::Base
128 end 128 end
129 129
130 def mark_as_unmergable 130 def mark_as_unmergable
131 - self.update_attributes :state => CANNOT_BE_MERGED 131 + self.update_attributes state: CANNOT_BE_MERGED
132 end 132 end
133 133
134 def reloaded_commits 134 def reloaded_commits
@@ -150,11 +150,11 @@ class MergeRequest &lt; ActiveRecord::Base @@ -150,11 +150,11 @@ class MergeRequest &lt; ActiveRecord::Base
150 def merge!(user_id) 150 def merge!(user_id)
151 self.mark_as_merged! 151 self.mark_as_merged!
152 Event.create( 152 Event.create(
153 - :project => self.project,  
154 - :action => Event::Merged,  
155 - :target_id => self.id,  
156 - :target_type => "MergeRequest",  
157 - :author_id => user_id 153 + project: self.project,
  154 + action: Event::Merged,
  155 + target_id: self.id,
  156 + target_type: "MergeRequest",
  157 + author_id: user_id
158 ) 158 )
159 end 159 end
160 160
app/models/milestone.rb
@@ -24,7 +24,7 @@ class Milestone &lt; ActiveRecord::Base @@ -24,7 +24,7 @@ class Milestone &lt; ActiveRecord::Base
24 end 24 end
25 25
26 def participants 26 def participants
27 - User.where(:id => issues.map(&:assignee_id)) 27 + User.where(id: issues.map(&:assignee_id))
28 end 28 end
29 29
30 def percent_complete 30 def percent_complete
app/models/note.rb
@@ -3,18 +3,18 @@ require &#39;file_size_validator&#39; @@ -3,18 +3,18 @@ require &#39;file_size_validator&#39;
3 3
4 class Note < ActiveRecord::Base 4 class Note < ActiveRecord::Base
5 belongs_to :project 5 belongs_to :project
6 - belongs_to :noteable, :polymorphic => true 6 + belongs_to :noteable, polymorphic: true
7 belongs_to :author, 7 belongs_to :author,
8 - :class_name => "User" 8 + class_name: "User"
9 9
10 delegate :name, 10 delegate :name,
11 - :to => :project,  
12 - :prefix => true 11 + to: :project,
  12 + prefix: true
13 13
14 delegate :name, 14 delegate :name,
15 :email, 15 :email,
16 - :to => :author,  
17 - :prefix => true 16 + to: :author,
  17 + prefix: true
18 18
19 attr_protected :author, :author_id 19 attr_protected :author, :author_id
20 attr_accessor :notify 20 attr_accessor :notify
@@ -23,19 +23,19 @@ class Note &lt; ActiveRecord::Base @@ -23,19 +23,19 @@ class Note &lt; ActiveRecord::Base
23 validates_presence_of :project 23 validates_presence_of :project
24 24
25 validates :note, 25 validates :note,
26 - :presence => true,  
27 - :length => { :within => 0..5000 } 26 + presence: true,
  27 + length: { within: 0..5000 }
28 28
29 validates :attachment, 29 validates :attachment,
30 - :file_size => {  
31 - :maximum => 10.megabytes.to_i 30 + file_size: {
  31 + maximum: 10.megabytes.to_i
32 } 32 }
33 33
34 - scope :common, where(:noteable_id => nil) 34 + scope :common, where(noteable_id: nil)
35 35
36 - scope :today, where("created_at >= :date", :date => Date.today)  
37 - scope :last_week, where("created_at >= :date", :date => (Date.today - 7.days))  
38 - scope :since, lambda { |day| where("created_at >= :date", :date => (day)) } 36 + scope :today, where("created_at >= :date", date: Date.today)
  37 + scope :last_week, where("created_at >= :date", date: (Date.today - 7.days))
  38 + scope :since, lambda { |day| where("created_at >= :date", date: (day)) }
39 scope :fresh, order("created_at DESC") 39 scope :fresh, order("created_at DESC")
40 scope :inc_author_project, includes(:project, :author) 40 scope :inc_author_project, includes(:project, :author)
41 scope :inc_author, includes(:author) 41 scope :inc_author, includes(:author)
@@ -43,11 +43,11 @@ class Note &lt; ActiveRecord::Base @@ -43,11 +43,11 @@ class Note &lt; ActiveRecord::Base
43 mount_uploader :attachment, AttachmentUploader 43 mount_uploader :attachment, AttachmentUploader
44 44
45 def self.create_status_change_note(noteable, author, status) 45 def self.create_status_change_note(noteable, author, status)
46 - create({ :noteable => noteable,  
47 - :project => noteable.project,  
48 - :author => author,  
49 - :note => "_Status changed to #{status}_" },  
50 - :without_protection => true) 46 + create({ noteable: noteable,
  47 + project: noteable.project,
  48 + author: author,
  49 + note: "_Status changed to #{status}_" },
  50 + without_protection: true)
51 end 51 end
52 52
53 def notify 53 def notify
app/models/project.rb
@@ -9,19 +9,19 @@ class Project &lt; ActiveRecord::Base @@ -9,19 +9,19 @@ class Project &lt; ActiveRecord::Base
9 # 9 #
10 # Relations 10 # Relations
11 # 11 #
12 - belongs_to :owner, :class_name => "User"  
13 - has_many :users, :through => :users_projects  
14 - has_many :events, :dependent => :destroy  
15 - has_many :merge_requests, :dependent => :destroy  
16 - has_many :issues, :dependent => :destroy, :order => "closed, created_at DESC"  
17 - has_many :milestones, :dependent => :destroy  
18 - has_many :users_projects, :dependent => :destroy  
19 - has_many :notes, :dependent => :destroy  
20 - has_many :snippets, :dependent => :destroy  
21 - has_many :deploy_keys, :dependent => :destroy, :foreign_key => "project_id", :class_name => "Key"  
22 - has_many :hooks, :dependent => :destroy, :class_name => "ProjectHook"  
23 - has_many :wikis, :dependent => :destroy  
24 - has_many :protected_branches, :dependent => :destroy 12 + belongs_to :owner, class_name: "User"
  13 + has_many :users, through: :users_projects
  14 + has_many :events, dependent: :destroy
  15 + has_many :merge_requests, dependent: :destroy
  16 + has_many :issues, dependent: :destroy, order: "closed, created_at DESC"
  17 + has_many :milestones, dependent: :destroy
  18 + has_many :users_projects, dependent: :destroy
  19 + has_many :notes, dependent: :destroy
  20 + has_many :snippets, dependent: :destroy
  21 + has_many :deploy_keys, dependent: :destroy, foreign_key: "project_id", class_name: "Key"
  22 + has_many :hooks, dependent: :destroy, class_name: "ProjectHook"
  23 + has_many :wikis, dependent: :destroy
  24 + has_many :protected_branches, dependent: :destroy
25 25
26 attr_accessor :error_code 26 attr_accessor :error_code
27 27
@@ -33,15 +33,15 @@ class Project &lt; ActiveRecord::Base @@ -33,15 +33,15 @@ class Project &lt; ActiveRecord::Base
33 # 33 #
34 # Scopes 34 # Scopes
35 # 35 #
36 - scope :public_only, where(:private_flag => false)  
37 - scope :without_user, lambda { |user| where("id not in (:ids)", :ids => user.projects.map(&:id) ) } 36 + scope :public_only, where(private_flag: false)
  37 + scope :without_user, lambda { |user| where("id not in (:ids)", ids: user.projects.map(&:id) ) }
38 38
39 def self.active 39 def self.active
40 joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC") 40 joins(:issues, :notes, :merge_requests).order("issues.created_at, notes.created_at, merge_requests.created_at DESC")
41 end 41 end
42 42
43 def self.search query 43 def self.search query
44 - where("name like :query or code like :query or path like :query", :query => "%#{query}%") 44 + where("name like :query or code like :query or path like :query", query: "%#{query}%")
45 end 45 end
46 46
47 def self.create_by_user(params, user) 47 def self.create_by_user(params, user)
@@ -53,7 +53,7 @@ class Project &lt; ActiveRecord::Base @@ -53,7 +53,7 @@ class Project &lt; ActiveRecord::Base
53 project.save! 53 project.save!
54 54
55 # Add user as project master 55 # Add user as project master
56 - project.users_projects.create!(:project_access => UsersProject::MASTER, :user => user) 56 + project.users_projects.create!(project_access: UsersProject::MASTER, user: user)
57 57
58 # when project saved no team member exist so 58 # when project saved no team member exist so
59 # project repository should be updated after first user add 59 # project repository should be updated after first user add
@@ -82,28 +82,28 @@ class Project &lt; ActiveRecord::Base @@ -82,28 +82,28 @@ class Project &lt; ActiveRecord::Base
82 # Validations 82 # Validations
83 # 83 #
84 validates :name, 84 validates :name,
85 - :uniqueness => true,  
86 - :presence => true,  
87 - :length => { :within => 0..255 } 85 + uniqueness: true,
  86 + presence: true,
  87 + length: { within: 0..255 }
88 88
89 validates :path, 89 validates :path,
90 - :uniqueness => true,  
91 - :presence => true,  
92 - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,  
93 - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" },  
94 - :length => { :within => 0..255 } 90 + uniqueness: true,
  91 + presence: true,
  92 + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
  93 + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
  94 + length: { within: 0..255 }
95 95
96 validates :description, 96 validates :description,
97 - :length => { :within => 0..2000 } 97 + length: { within: 0..2000 }
98 98
99 validates :code, 99 validates :code,
100 - :presence => true,  
101 - :uniqueness => true,  
102 - :format => { :with => /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,  
103 - :message => "only letters, digits & '_' '-' '.' allowed. Letter should be first" },  
104 - :length => { :within => 1..255 } 100 + presence: true,
  101 + uniqueness: true,
  102 + format: { with: /^[a-zA-Z][a-zA-Z0-9_\-\.]*$/,
  103 + message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" },
  104 + length: { within: 1..255 }
105 105
106 - validates :owner, :presence => true 106 + validates :owner, presence: true
107 validate :check_limit 107 validate :check_limit
108 validate :repo_name 108 validate :repo_name
109 109
@@ -134,19 +134,19 @@ class Project &lt; ActiveRecord::Base @@ -134,19 +134,19 @@ class Project &lt; ActiveRecord::Base
134 end 134 end
135 135
136 def common_notes 136 def common_notes
137 - notes.where(:noteable_type => ["", nil]).inc_author_project 137 + notes.where(noteable_type: ["", nil]).inc_author_project
138 end 138 end
139 139
140 def build_commit_note(commit) 140 def build_commit_note(commit)
141 - notes.new(:noteable_id => commit.id, :noteable_type => "Commit") 141 + notes.new(noteable_id: commit.id, noteable_type: "Commit")
142 end 142 end
143 143
144 def commit_notes(commit) 144 def commit_notes(commit)
145 - notes.where(:noteable_id => commit.id, :noteable_type => "Commit", :line_code => nil) 145 + notes.where(noteable_id: commit.id, noteable_type: "Commit", line_code: nil)
146 end 146 end
147 147
148 def commit_line_notes(commit) 148 def commit_line_notes(commit)
149 - notes.where(:noteable_id => commit.id, :noteable_type => "Commit").where("line_code is not null") 149 + notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null")
150 end 150 end
151 151
152 def public? 152 def public?
app/models/snippet.rb
@@ -2,29 +2,29 @@ class Snippet &lt; ActiveRecord::Base @@ -2,29 +2,29 @@ class Snippet &lt; ActiveRecord::Base
2 include Linguist::BlobHelper 2 include Linguist::BlobHelper
3 3
4 belongs_to :project 4 belongs_to :project
5 - belongs_to :author, :class_name => "User"  
6 - has_many :notes, :as => :noteable, :dependent => :destroy 5 + belongs_to :author, class_name: "User"
  6 + has_many :notes, as: :noteable, dependent: :destroy
7 7
8 delegate :name, 8 delegate :name,
9 :email, 9 :email,
10 - :to => :author,  
11 - :prefix => true 10 + to: :author,
  11 + prefix: true
12 attr_protected :author, :author_id, :project, :project_id 12 attr_protected :author, :author_id, :project, :project_id
13 13
14 validates_presence_of :project_id 14 validates_presence_of :project_id
15 validates_presence_of :author_id 15 validates_presence_of :author_id
16 16
17 validates :title, 17 validates :title,
18 - :presence => true,  
19 - :length => { :within => 0..255 } 18 + presence: true,
  19 + length: { within: 0..255 }
20 20
21 validates :file_name, 21 validates :file_name,
22 - :presence => true,  
23 - :length => { :within => 0..255 } 22 + presence: true,
  23 + length: { within: 0..255 }
24 24
25 validates :content, 25 validates :content,
26 - :presence => true,  
27 - :length => { :within => 0..10000 } 26 + presence: true,
  27 + length: { within: 0..10000 }
28 28
29 scope :fresh, order("created_at DESC") 29 scope :fresh, order("created_at DESC")
30 scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current]) 30 scope :non_expired, where(["expires_at IS NULL OR expires_at > ?", Time.current])
app/models/tree.rb
@@ -11,7 +11,7 @@ class Tree @@ -11,7 +11,7 @@ class Tree
11 :size, 11 :size,
12 :text?, 12 :text?,
13 :colorize, 13 :colorize,
14 - :to => :tree 14 + to: :tree
15 15
16 def initialize(raw_tree, project, ref = nil, path = nil) 16 def initialize(raw_tree, project, ref = nil, path = nil)
17 @project, @ref, @path = project, ref, path, 17 @project, @ref, @path = project, ref, path,
app/models/user.rb
@@ -11,58 +11,58 @@ class User &lt; ActiveRecord::Base @@ -11,58 +11,58 @@ class User &lt; ActiveRecord::Base
11 11
12 attr_accessor :force_random_password 12 attr_accessor :force_random_password
13 13
14 - has_many :users_projects, :dependent => :destroy  
15 - has_many :projects, :through => :users_projects  
16 - has_many :my_own_projects, :class_name => "Project", :foreign_key => :owner_id  
17 - has_many :keys, :dependent => :destroy 14 + has_many :users_projects, dependent: :destroy
  15 + has_many :projects, through: :users_projects
  16 + has_many :my_own_projects, class_name: "Project", foreign_key: :owner_id
  17 + has_many :keys, dependent: :destroy
18 18
19 has_many :events, 19 has_many :events,
20 - :class_name => "Event",  
21 - :foreign_key => :author_id,  
22 - :dependent => :destroy 20 + class_name: "Event",
  21 + foreign_key: :author_id,
  22 + dependent: :destroy
23 23
24 has_many :recent_events, 24 has_many :recent_events,
25 - :class_name => "Event",  
26 - :foreign_key => :author_id,  
27 - :order => "id DESC" 25 + class_name: "Event",
  26 + foreign_key: :author_id,
  27 + order: "id DESC"
28 28
29 has_many :issues, 29 has_many :issues,
30 - :foreign_key => :author_id,  
31 - :dependent => :destroy 30 + foreign_key: :author_id,
  31 + dependent: :destroy
32 32
33 has_many :notes, 33 has_many :notes,
34 - :foreign_key => :author_id,  
35 - :dependent => :destroy 34 + foreign_key: :author_id,
  35 + dependent: :destroy
36 36
37 has_many :assigned_issues, 37 has_many :assigned_issues,
38 - :class_name => "Issue",  
39 - :foreign_key => :assignee_id,  
40 - :dependent => :destroy 38 + class_name: "Issue",
  39 + foreign_key: :assignee_id,
  40 + dependent: :destroy
41 41
42 has_many :merge_requests, 42 has_many :merge_requests,
43 - :foreign_key => :author_id,  
44 - :dependent => :destroy 43 + foreign_key: :author_id,
  44 + dependent: :destroy
45 45
46 has_many :assigned_merge_requests, 46 has_many :assigned_merge_requests,
47 - :class_name => "MergeRequest",  
48 - :foreign_key => :assignee_id,  
49 - :dependent => :destroy 47 + class_name: "MergeRequest",
  48 + foreign_key: :assignee_id,
  49 + dependent: :destroy
50 50
51 validates :projects_limit, 51 validates :projects_limit,
52 - :presence => true,  
53 - :numericality => {:greater_than_or_equal_to => 0} 52 + presence: true,
  53 + numericality: {greater_than_or_equal_to: 0}
54 54
55 - validates :bio, :length => { :within => 0..255 } 55 + validates :bio, length: { within: 0..255 }
56 56
57 before_save :ensure_authentication_token 57 before_save :ensure_authentication_token
58 alias_attribute :private_token, :authentication_token 58 alias_attribute :private_token, :authentication_token
59 59
60 - scope :not_in_project, lambda { |project| where("id not in (:ids)", :ids => project.users.map(&:id) ) }  
61 - scope :admins, where(:admin => true)  
62 - scope :blocked, where(:blocked => true)  
63 - scope :active, where(:blocked => false) 60 + scope :not_in_project, lambda { |project| where("id not in (:ids)", ids: project.users.map(&:id) ) }
  61 + scope :admins, where(admin: true)
  62 + scope :blocked, where(blocked: true)
  63 + scope :active, where(blocked: false)
64 64
65 - before_validation :generate_password, :on => :create 65 + before_validation :generate_password, on: :create
66 66
67 def generate_password 67 def generate_password
68 if self.force_random_password 68 if self.force_random_password
@@ -94,17 +94,17 @@ class User &lt; ActiveRecord::Base @@ -94,17 +94,17 @@ class User &lt; ActiveRecord::Base
94 else 94 else
95 password = Devise.friendly_token[0, 8].downcase 95 password = Devise.friendly_token[0, 8].downcase
96 @user = User.create( 96 @user = User.create(
97 - :name => name,  
98 - :email => email,  
99 - :password => password,  
100 - :password_confirmation => password,  
101 - :projects_limit => Gitlab.config.default_projects_limit 97 + name: name,
  98 + email: email,
  99 + password: password,
  100 + password_confirmation: password,
  101 + projects_limit: Gitlab.config.default_projects_limit
102 ) 102 )
103 end 103 end
104 end 104 end
105 105
106 def self.search query 106 def self.search query
107 - where("name like :query or email like :query", :query => "%#{query}%") 107 + where("name like :query or email like :query", query: "%#{query}%")
108 end 108 end
109 end 109 end
110 # == Schema Information 110 # == Schema Information
app/models/users_project.rb
@@ -12,18 +12,18 @@ class UsersProject &lt; ActiveRecord::Base @@ -12,18 +12,18 @@ class UsersProject &lt; ActiveRecord::Base
12 after_save :update_repository 12 after_save :update_repository
13 after_destroy :update_repository 13 after_destroy :update_repository
14 14
15 - validates_uniqueness_of :user_id, :scope => [:project_id] 15 + validates_uniqueness_of :user_id, scope: [:project_id]
16 validates_presence_of :user_id 16 validates_presence_of :user_id
17 validates_presence_of :project_id 17 validates_presence_of :project_id
18 18
19 - delegate :name, :email, :to => :user, :prefix => true 19 + delegate :name, :email, to: :user, prefix: true
20 20
21 def self.bulk_import(project, user_ids, project_access) 21 def self.bulk_import(project, user_ids, project_access)
22 UsersProject.transaction do 22 UsersProject.transaction do
23 user_ids.each do |user_id| 23 user_ids.each do |user_id|
24 users_project = UsersProject.new( 24 users_project = UsersProject.new(
25 - :project_access => project_access,  
26 - :user_id => user_id 25 + project_access: project_access,
  26 + user_id: user_id
27 ) 27 )
28 users_project.project = project 28 users_project.project = project
29 users_project.save 29 users_project.save
@@ -35,7 +35,7 @@ class UsersProject &lt; ActiveRecord::Base @@ -35,7 +35,7 @@ class UsersProject &lt; ActiveRecord::Base
35 UsersProject.transaction do 35 UsersProject.transaction do
36 project_ids.each do |project_id| 36 project_ids.each do |project_id|
37 users_project = UsersProject.new( 37 users_project = UsersProject.new(
38 - :project_access => project_access, 38 + project_access: project_access,
39 ) 39 )
40 users_project.project_id = project_id 40 users_project.project_id = project_id
41 users_project.user_id = user.id 41 users_project.user_id = user.id
app/models/wiki.rb
1 class Wiki < ActiveRecord::Base 1 class Wiki < ActiveRecord::Base
2 belongs_to :project 2 belongs_to :project
3 belongs_to :user 3 belongs_to :user
4 - has_many :notes, :as => :noteable, :dependent => :destroy 4 + has_many :notes, as: :noteable, dependent: :destroy
5 5
6 - validates :content, :title, :user_id, :presence => true  
7 - validates :title, :length => 1..250 6 + validates :content, :title, :user_id, presence: true
  7 + validates :title, length: 1..250
8 8
9 before_update :set_slug 9 before_update :set_slug
10 10
app/observers/activity_observer.rb
@@ -3,22 +3,22 @@ class ActivityObserver &lt; ActiveRecord::Observer @@ -3,22 +3,22 @@ class ActivityObserver &lt; ActiveRecord::Observer
3 3
4 def after_create(record) 4 def after_create(record)
5 Event.create( 5 Event.create(
6 - :project => record.project,  
7 - :target_id => record.id,  
8 - :target_type => record.class.name,  
9 - :action => Event.determine_action(record),  
10 - :author_id => record.author_id 6 + project: record.project,
  7 + target_id: record.id,
  8 + target_type: record.class.name,
  9 + action: Event.determine_action(record),
  10 + author_id: record.author_id
11 ) 11 )
12 end 12 end
13 13
14 def after_save(record) 14 def after_save(record)
15 if record.changed.include?("closed") 15 if record.changed.include?("closed")
16 Event.create( 16 Event.create(
17 - :project => record.project,  
18 - :target_id => record.id,  
19 - :target_type => record.class.name,  
20 - :action => (record.closed ? Event::Closed : Event::Reopened),  
21 - :author_id => record.author_id_of_changes 17 + project: record.project,
  18 + target_id: record.id,
  19 + target_type: record.class.name,
  20 + action: (record.closed ? Event::Closed : Event::Reopened),
  21 + author_id: record.author_id_of_changes
22 ) 22 )
23 end 23 end
24 end 24 end
app/observers/mailer_observer.rb
@@ -71,7 +71,7 @@ class MailerObserver &lt; ActiveRecord::Observer @@ -71,7 +71,7 @@ class MailerObserver &lt; ActiveRecord::Observer
71 71
72 # Create comment about status changed 72 # Create comment about status changed
73 if target.closed_changed? 73 if target.closed_changed?
74 - note = Note.new(:noteable => target, :project => target.project) 74 + note = Note.new(noteable: target, project: target.project)
75 note.author = current_user 75 note.author = current_user
76 note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_" 76 note.note = "_Status changed to #{target.closed ? 'closed' : 'reopened'}_"
77 note.save() 77 note.save()
app/roles/account.rb
@@ -24,7 +24,7 @@ module Account @@ -24,7 +24,7 @@ module Account
24 end 24 end
25 25
26 def cared_merge_requests 26 def cared_merge_requests
27 - MergeRequest.where("author_id = :id or assignee_id = :id", :id => self.id).opened 27 + MergeRequest.where("author_id = :id or assignee_id = :id", id: self.id).opened
28 end 28 end
29 29
30 def project_ids 30 def project_ids
@@ -50,7 +50,7 @@ module Account @@ -50,7 +50,7 @@ module Account
50 def recent_push project_id = nil 50 def recent_push project_id = nil
51 # Get push events not earlier than 2 hours ago 51 # Get push events not earlier than 2 hours ago
52 events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours) 52 events = recent_events.code_push.where("created_at > ?", Time.now - 2.hours)
53 - events = events.where(:project_id => project_id) if project_id 53 + events = events.where(project_id: project_id) if project_id
54 54
55 # Take only latest one 55 # Take only latest one
56 events = events.recent.limit(1).first 56 events = events.recent.limit(1).first
app/roles/authority.rb
@@ -3,56 +3,56 @@ module Authority @@ -3,56 +3,56 @@ module Authority
3 # Should be rewrited for new access rights 3 # Should be rewrited for new access rights
4 def add_access(user, *access) 4 def add_access(user, *access)
5 access = if access.include?(:admin) 5 access = if access.include?(:admin)
6 - { :project_access => UsersProject::MASTER } 6 + { project_access: UsersProject::MASTER }
7 elsif access.include?(:write) 7 elsif access.include?(:write)
8 - { :project_access => UsersProject::DEVELOPER } 8 + { project_access: UsersProject::DEVELOPER }
9 else 9 else
10 - { :project_access => UsersProject::REPORTER } 10 + { project_access: UsersProject::REPORTER }
11 end 11 end
12 - opts = { :user => user } 12 + opts = { user: user }
13 opts.merge!(access) 13 opts.merge!(access)
14 users_projects.create(opts) 14 users_projects.create(opts)
15 end 15 end
16 16
17 def reset_access(user) 17 def reset_access(user)
18 - users_projects.where(:project_id => self.id, :user_id => user.id).destroy if self.id 18 + users_projects.where(project_id: self.id, user_id: user.id).destroy if self.id
19 end 19 end
20 20
21 def repository_readers 21 def repository_readers
22 - keys = Key.joins({:user => :users_projects}). 22 + keys = Key.joins({user: :users_projects}).
23 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER) 23 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::REPORTER)
24 keys.map(&:identifier) + deploy_keys.map(&:identifier) 24 keys.map(&:identifier) + deploy_keys.map(&:identifier)
25 end 25 end
26 26
27 def repository_writers 27 def repository_writers
28 - keys = Key.joins({:user => :users_projects}). 28 + keys = Key.joins({user: :users_projects}).
29 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER) 29 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::DEVELOPER)
30 keys.map(&:identifier) 30 keys.map(&:identifier)
31 end 31 end
32 32
33 def repository_masters 33 def repository_masters
34 - keys = Key.joins({:user => :users_projects}). 34 + keys = Key.joins({user: :users_projects}).
35 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER) 35 where("users_projects.project_id = ? AND users_projects.project_access = ?", id, UsersProject::MASTER)
36 keys.map(&:identifier) 36 keys.map(&:identifier)
37 end 37 end
38 38
39 def allow_read_for?(user) 39 def allow_read_for?(user)
40 - !users_projects.where(:user_id => user.id).empty? 40 + !users_projects.where(user_id: user.id).empty?
41 end 41 end
42 42
43 def guest_access_for?(user) 43 def guest_access_for?(user)
44 - !users_projects.where(:user_id => user.id).empty? 44 + !users_projects.where(user_id: user.id).empty?
45 end 45 end
46 46
47 def report_access_for?(user) 47 def report_access_for?(user)
48 - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty? 48 + !users_projects.where(user_id: user.id, project_access: [UsersProject::REPORTER, UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
49 end 49 end
50 50
51 def dev_access_for?(user) 51 def dev_access_for?(user)
52 - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::DEVELOPER, UsersProject::MASTER]).empty? 52 + !users_projects.where(user_id: user.id, project_access: [UsersProject::DEVELOPER, UsersProject::MASTER]).empty?
53 end 53 end
54 54
55 def master_access_for?(user) 55 def master_access_for?(user)
56 - !users_projects.where(:user_id => user.id, :project_access => [UsersProject::MASTER]).empty? || owner_id == user.id 56 + !users_projects.where(user_id: user.id, project_access: [UsersProject::MASTER]).empty? || owner_id == user.id
57 end 57 end
58 end 58 end
app/roles/issue_commonality.rb
@@ -6,39 +6,39 @@ module IssueCommonality @@ -6,39 +6,39 @@ module IssueCommonality
6 attr_protected :author, :author_id, :project, :project_id 6 attr_protected :author, :author_id, :project, :project_id
7 7
8 belongs_to :project 8 belongs_to :project
9 - belongs_to :author, :class_name => "User"  
10 - belongs_to :assignee, :class_name => "User"  
11 - has_many :notes, :as => :noteable, :dependent => :destroy 9 + belongs_to :author, class_name: "User"
  10 + belongs_to :assignee, class_name: "User"
  11 + has_many :notes, as: :noteable, dependent: :destroy
12 12
13 validates_presence_of :project_id 13 validates_presence_of :project_id
14 validates_presence_of :author_id 14 validates_presence_of :author_id
15 15
16 validates :title, 16 validates :title,
17 - :presence => true,  
18 - :length => { :within => 0..255 } 17 + presence: true,
  18 + length: { within: 0..255 }
19 19
20 20
21 - scope :opened, where(:closed => false)  
22 - scope :closed, where(:closed => true)  
23 - scope :assigned, lambda { |u| where(:assignee_id => u.id)} 21 + scope :opened, where(closed: false)
  22 + scope :closed, where(closed: true)
  23 + scope :assigned, lambda { |u| where(assignee_id: u.id)}
24 24
25 delegate :name, 25 delegate :name,
26 :email, 26 :email,
27 - :to => :author,  
28 - :prefix => true 27 + to: :author,
  28 + prefix: true
29 29
30 delegate :name, 30 delegate :name,
31 :email, 31 :email,
32 - :to => :assignee,  
33 - :allow_nil => true,  
34 - :prefix => true 32 + to: :assignee,
  33 + allow_nil: true,
  34 + prefix: true
35 35
36 attr_accessor :author_id_of_changes 36 attr_accessor :author_id_of_changes
37 end 37 end
38 38
39 module ClassMethods 39 module ClassMethods
40 def search(query) 40 def search(query)
41 - where("title like :query", :query => "%#{query}%") 41 + where("title like :query", query: "%#{query}%")
42 end 42 end
43 end 43 end
44 44
app/roles/project_push.rb
@@ -3,10 +3,10 @@ module ProjectPush @@ -3,10 +3,10 @@ module ProjectPush
3 data = post_receive_data(oldrev, newrev, ref, user) 3 data = post_receive_data(oldrev, newrev, ref, user)
4 4
5 Event.create( 5 Event.create(
6 - :project => self,  
7 - :action => Event::Pushed,  
8 - :data => data,  
9 - :author_id => data[:user_id] 6 + project: self,
  7 + action: Event::Pushed,
  8 + data: data,
  9 + author_id: data[:user_id]
10 ) 10 )
11 end 11 end
12 12
@@ -20,7 +20,7 @@ module ProjectPush @@ -20,7 +20,7 @@ module ProjectPush
20 mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked } 20 mrs.each { |merge_request| merge_request.reload_code; merge_request.mark_as_unchecked }
21 21
22 # Close merge requests 22 # Close merge requests
23 - mrs = self.merge_requests.opened.where(:target_branch => branch_name).all 23 + mrs = self.merge_requests.opened.where(target_branch: branch_name).all
24 mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) } 24 mrs = mrs.select(&:last_commit).select { |mr| c_ids.include?(mr.last_commit.id) }
25 mrs.each { |merge_request| merge_request.merge!(user.id) } 25 mrs.each { |merge_request| merge_request.merge!(user.id) }
26 26
app/roles/ssh_key.rb
@@ -9,7 +9,7 @@ module SshKey @@ -9,7 +9,7 @@ module SshKey
9 def repository_delete_key 9 def repository_delete_key
10 Gitlab::GitHost.system.new.configure do |c| 10 Gitlab::GitHost.system.new.configure do |c|
11 #delete key file is there is no identically deploy keys 11 #delete key file is there is no identically deploy keys
12 - if !is_deploy_key || Key.where(:identifier => identifier).count() == 0 12 + if !is_deploy_key || Key.where(identifier: identifier).count() == 0
13 c.delete_key(identifier) 13 c.delete_key(identifier)
14 end 14 end
15 c.update_projects(projects) 15 c.update_projects(projects)
app/roles/team.rb
@@ -25,8 +25,8 @@ module Team @@ -25,8 +25,8 @@ module Team
25 # with passed access role by user id 25 # with passed access role by user id
26 def add_user_id_to_team(user_id, access_role) 26 def add_user_id_to_team(user_id, access_role)
27 users_projects.create( 27 users_projects.create(
28 - :user_id => user_id,  
29 - :project_access => access_role 28 + user_id: user_id,
  29 + project_access: access_role
30 ) 30 )
31 end 31 end
32 32
app/uploaders/attachment_uploader.rb
@@ -23,7 +23,7 @@ class AttachmentUploader &lt; CarrierWave::Uploader::Base @@ -23,7 +23,7 @@ class AttachmentUploader &lt; CarrierWave::Uploader::Base
23 # end 23 # end
24 24
25 # Process files as they are uploaded: 25 # Process files as they are uploaded:
26 - # process :scale => [200, 300] 26 + # process scale: [200, 300]
27 # 27 #
28 # def scale(width, height) 28 # def scale(width, height)
29 # # do something 29 # # do something
@@ -31,7 +31,7 @@ class AttachmentUploader &lt; CarrierWave::Uploader::Base @@ -31,7 +31,7 @@ class AttachmentUploader &lt; CarrierWave::Uploader::Base
31 31
32 # Create different versions of your uploaded files: 32 # Create different versions of your uploaded files:
33 # version :thumb do 33 # version :thumb do
34 - # process :scale => [50, 50] 34 + # process scale: [50, 50]
35 # end 35 # end
36 36
37 # Add a white list of extensions which are allowed to be uploaded. 37 # Add a white list of extensions which are allowed to be uploaded.
app/views/admin/dashboard/index.html.haml
@@ -5,11 +5,11 @@ @@ -5,11 +5,11 @@
5 Resque Workers 5 Resque Workers
6 .data.padded 6 .data.padded
7 = link_to admin_resque_path do 7 = link_to admin_resque_path do
8 - %h1{:class => @workers.present? ? "cgreen" : "cred"} 8 + %h1{class: @workers.present? ? "cgreen" : "cred"}
9 = @workers.count 9 = @workers.count
10 %hr 10 %hr
11 %p 11 %p
12 - %strong{:class => @pending_jobs > 0 ? "cred" : "cgreen"} 12 + %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"}
13 #{@pending_jobs} post receive jobs waiting 13 #{@pending_jobs} post receive jobs waiting
14 14
15 .span4 15 .span4
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 = link_to admin_projects_path do 19 = link_to admin_projects_path do
20 %h1= Project.count 20 %h1= Project.count
21 %hr 21 %hr
22 - = link_to 'New Project', new_admin_project_path, :class => "btn small" 22 + = link_to 'New Project', new_admin_project_path, class: "btn small"
23 .span4 23 .span4
24 .ui-box 24 .ui-box
25 %h5 Users 25 %h5 Users
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 = link_to admin_users_path do 27 = link_to admin_users_path do
28 %h1= User.count 28 %h1= User.count
29 %hr 29 %hr
30 - = link_to 'New User', new_admin_user_path, :class => "btn small" 30 + = link_to 'New User', new_admin_user_path, class: "btn small"
31 31
32 32
33 .row 33 .row
app/views/admin/hooks/index.html.haml
@@ -3,9 +3,9 @@ @@ -3,9 +3,9 @@
3 Post receive hooks for binding events. 3 Post receive hooks for binding events.
4 %br 4 %br
5 Read more about system hooks 5 Read more about system hooks
6 - %strong #{link_to "here", help_system_hooks_path, :class => "vlink"} 6 + %strong #{link_to "here", help_system_hooks_path, class: "vlink"}
7 7
8 -= form_for @hook, :as => :hook, :url => admin_hooks_path do |f| 8 += form_for @hook, as: :hook, url: admin_hooks_path do |f|
9 -if @hook.errors.any? 9 -if @hook.errors.any?
10 .alert-message.block-message.error 10 .alert-message.block-message.error
11 - @hook.errors.full_messages.each do |msg| 11 - @hook.errors.full_messages.each do |msg|
@@ -13,9 +13,9 @@ @@ -13,9 +13,9 @@
13 .clearfix 13 .clearfix
14 = f.label :url, "URL:" 14 = f.label :url, "URL:"
15 .input 15 .input
16 - = f.text_field :url, :class => "text_field xxlarge" 16 + = f.text_field :url, class: "text_field xxlarge"
17 &nbsp; 17 &nbsp;
18 - = f.submit "Add System Hook", :class => "btn primary" 18 + = f.submit "Add System Hook", class: "btn primary"
19 %hr 19 %hr
20 20
21 -if @hooks.any? 21 -if @hooks.any?
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 %td 33 %td
34 = link_to admin_hook_path(hook) do 34 = link_to admin_hook_path(hook) do
35 %strong= hook.url 35 %strong= hook.url
36 - = link_to 'Test Hook', admin_hook_test_path(hook), :class => "btn small right" 36 + = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn small right"
37 %td POST 37 %td POST
38 %td 38 %td
39 - = link_to 'Remove', admin_hook_path(hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" 39 + = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
app/views/admin/projects/_form.html.haml
@@ -9,8 +9,8 @@ @@ -9,8 +9,8 @@
9 = f.label :name do 9 = f.label :name do
10 Project name is 10 Project name is
11 .input 11 .input
12 - = f.text_field :name, :placeholder => "Example Project", :class => "xxlarge"  
13 - = f.submit project.new_record? ? 'Create project' : 'Save Project', :class => "btn primary" 12 + = f.text_field :name, placeholder: "Example Project", class: "xxlarge"
  13 + = f.submit project.new_record? ? 'Create project' : 'Save Project', class: "btn primary"
14 14
15 %hr 15 %hr
16 .alert.alert-info 16 .alert.alert-info
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 .input 21 .input
22 .input-prepend 22 .input-prepend
23 %span.add-on= Gitlab.config.ssh_path 23 %span.add-on= Gitlab.config.ssh_path
24 - = f.text_field :path, :placeholder => "example_project", :disabled => !!project.id 24 + = f.text_field :path, placeholder: "example_project", disabled: !!project.id
25 %span.add-on= ".git" 25 %span.add-on= ".git"
26 .clearfix 26 .clearfix
27 = f.label :code do 27 = f.label :code do
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 .input 29 .input
30 .input-prepend 30 .input-prepend
31 %span.add-on= web_app_url 31 %span.add-on= web_app_url
32 - = f.text_field :code, :placeholder => "example" 32 + = f.text_field :code, placeholder: "example"
33 33
34 - unless project.new_record? 34 - unless project.new_record?
35 .clearfix 35 .clearfix
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 - if project.repo_exists? 39 - if project.repo_exists?
40 .clearfix 40 .clearfix
41 = f.label :default_branch, "Default Branch" 41 = f.label :default_branch, "Default Branch"
42 - .input= f.select(:default_branch, project.heads.map(&:name), {}, :style => "width:210px;") 42 + .input= f.select(:default_branch, project.heads.map(&:name), {}, style: "width:210px;")
43 43
44 - unless project.new_record? 44 - unless project.new_record?
45 .alert.alert-info 45 .alert.alert-info
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 63
64 - unless project.new_record? 64 - unless project.new_record?
65 .actions 65 .actions
66 - = f.submit 'Save Project', :class => "btn primary" 66 + = f.submit 'Save Project', class: "btn primary"
67 67
68 68
69 69
app/views/admin/projects/edit.html.haml
1 %h3.page_title #{@admin_project.name} &rarr; Edit project 1 %h3.page_title #{@admin_project.name} &rarr; Edit project
2 %hr 2 %hr
3 -= render 'form', :project => @admin_project 3 += render 'form', project: @admin_project
app/views/admin/projects/index.html.haml
1 %h3 1 %h3
2 Projects 2 Projects
3 - = link_to 'New Project', new_admin_project_path, :class => "btn small right" 3 + = link_to 'New Project', new_admin_project_path, class: "btn small right"
4 %br 4 %br
5 -= form_tag admin_projects_path, :method => :get do  
6 - = text_field_tag :name, params[:name], :class => "xlarge"  
7 - = submit_tag "Search", :class => "btn submit primary" 5 += form_tag admin_projects_path, method: :get do
  6 + = text_field_tag :name, params[:name], class: "xlarge"
  7 + = submit_tag "Search", class: "btn submit primary"
8 8
9 %table.admin-table 9 %table.admin-table
10 %thead 10 %thead
@@ -21,8 +21,8 @@ @@ -21,8 +21,8 @@
21 %td= link_to project.name, [:admin, project] 21 %td= link_to project.name, [:admin, project]
22 %td= project.path 22 %td= project.path
23 %td= project.users_projects.count 23 %td= project.users_projects.count
24 - %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, :disabled => true 24 + %td= check_box_tag :post_receive_file, 1, project.has_post_receive_file?, disabled: true
25 %td= last_commit(project) 25 %td= last_commit(project)
26 - %td= link_to 'Edit', edit_admin_project_path(project), :id => "edit_#{dom_id(project)}", :class => "btn small"  
27 - %td.bgred= link_to 'Destroy', [:admin, project], :confirm => "REMOVE #{project.name}? Are you sure?", :method => :delete, :class => "btn small danger"  
28 -= paginate @admin_projects, :theme => "admin" 26 + %td= link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small"
  27 + %td.bgred= link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger"
  28 += paginate @admin_projects, theme: "admin"
app/views/admin/projects/new.html.haml
1 %h3.page_title New project 1 %h3.page_title New project
2 %hr 2 %hr
3 -= render 'form', :project => @admin_project 3 += render 'form', project: @admin_project
app/views/admin/projects/show.html.haml
1 %h3 1 %h3
2 = @admin_project.name 2 = @admin_project.name
3 - = link_to 'Edit', edit_admin_project_path(@admin_project), :class => "btn right small" 3 + = link_to 'Edit', edit_admin_project_path(@admin_project), class: "btn right small"
4 4
5 %br 5 %br
6 %table.zebra-striped.table-bordered 6 %table.zebra-striped.table-bordered
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 %b 33 %b
34 Post Receive File: 34 Post Receive File:
35 %td 35 %td
36 - = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, :disabled => true 36 + = check_box_tag :post_receive_file, 1, @admin_project.has_post_receive_file?, disabled: true
37 %br 37 %br
38 %h3 38 %h3
39 Team 39 Team
@@ -52,14 +52,14 @@ @@ -52,14 +52,14 @@
52 %tr 52 %tr
53 %td 53 %td
54 = link_to tm.user_name, admin_user_path(tm.user) 54 = link_to tm.user_name, admin_user_path(tm.user)
55 - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled  
56 - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small"  
57 - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn danger small" 55 + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled
  56 + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
  57 + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small"
58 58
59 %br 59 %br
60 %h3 Add new team member 60 %h3 Add new team member
61 %br 61 %br
62 -= form_tag team_update_admin_project_path(@admin_project), :class => "bulk_import", :method => :put do 62 += form_tag team_update_admin_project_path(@admin_project), class: "bulk_import", method: :put do
63 %table.zebra-striped.table-bordered 63 %table.zebra-striped.table-bordered
64 %thead 64 %thead
65 %tr 65 %tr
@@ -67,14 +67,14 @@ @@ -67,14 +67,14 @@
67 %th Project Access: 67 %th Project Access:
68 68
69 %tr 69 %tr
70 - %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), :multiple => true  
71 - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" 70 + %td= select_tag :user_ids, options_from_collection_for_select(@users , :id, :name), multiple: true
  71 + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select"
72 72
73 %tr 73 %tr
74 - %td= submit_tag 'Add', :class => "btn primary" 74 + %td= submit_tag 'Add', class: "btn primary"
75 %td 75 %td
76 Read more about project permissions 76 Read more about project permissions
77 - %strong= link_to "here", help_permissions_path, :class => "vlink" 77 + %strong= link_to "here", help_permissions_path, class: "vlink"
78 78
79 :css 79 :css
80 form select { 80 form select {
app/views/admin/resque/show.html.haml
1 %h3 Resque 1 %h3 Resque
2 -%iframe{:src => "/info/resque", :width => 1168, :height => 600, :style => "border: none"}  
3 \ No newline at end of file 2 \ No newline at end of file
  3 +%iframe{src: "/info/resque", width: 1168, height: 600, style: "border: none"}
4 \ No newline at end of file 4 \ No newline at end of file
app/views/admin/team_members/_form.html.haml
1 -= form_for @admin_team_member, :as => :team_member, :url => admin_team_member_path(@admin_team_member) do |f| 1 += form_for @admin_team_member, as: :team_member, url: admin_team_member_path(@admin_team_member) do |f|
2 -if @admin_team_member.errors.any? 2 -if @admin_team_member.errors.any?
3 .alert-message.block-message.error 3 .alert-message.block-message.error
4 %ul 4 %ul
@@ -8,12 +8,12 @@ @@ -8,12 +8,12 @@
8 .clearfix 8 .clearfix
9 %label Project Access: 9 %label Project Access:
10 .input 10 .input
11 - = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, :class => "project-access-select" 11 + = f.select :project_access, options_for_select(Project.access_options, @admin_team_member.project_access), {}, class: "project-access-select"
12 12
13 %br 13 %br
14 .actions 14 .actions
15 - = f.submit 'Save', :class => "btn primary"  
16 - = link_to 'Cancel', :back, :class => "btn" 15 + = f.submit 'Save', class: "btn primary"
  16 + = link_to 'Cancel', :back, class: "btn"
17 17
18 :css 18 :css
19 form select { 19 form select {
app/views/admin/users/_form.html.haml
@@ -22,17 +22,17 @@ @@ -22,17 +22,17 @@
22 22
23 -if f.object.new_record? 23 -if f.object.new_record?
24 .clearfix 24 .clearfix
25 - = f.label :admin, :class => "checkbox" do 25 + = f.label :admin, class: "checkbox" do
26 = f.check_box :force_random_password, {}, true, nil 26 = f.check_box :force_random_password, {}, true, nil
27 %span Generate random password 27 %span Generate random password
28 28
29 %div.password-fields 29 %div.password-fields
30 .clearfix 30 .clearfix
31 = f.label :password 31 = f.label :password
32 - .input= f.password_field :password, :disabled => f.object.force_random_password 32 + .input= f.password_field :password, disabled: f.object.force_random_password
33 .clearfix 33 .clearfix
34 = f.label :password_confirmation 34 = f.label :password_confirmation
35 - .input= f.password_field :password_confirmation, :disabled => f.object.force_random_password 35 + .input= f.password_field :password_confirmation, disabled: f.object.force_random_password
36 %hr 36 %hr
37 .clearfix 37 .clearfix
38 = f.label :skype 38 = f.label :skype
@@ -46,27 +46,27 @@ @@ -46,27 +46,27 @@
46 .span6 46 .span6
47 .clearfix 47 .clearfix
48 = f.label :projects_limit 48 = f.label :projects_limit
49 - .input= f.text_field :projects_limit, :class => "small_input" 49 + .input= f.text_field :projects_limit, class: "small_input"
50 50
51 .alert 51 .alert
52 .clearfix 52 .clearfix
53 %p Make the user a GitLab administrator. 53 %p Make the user a GitLab administrator.
54 - = f.label :admin, :class => "checkbox" do 54 + = f.label :admin, class: "checkbox" do
55 = f.check_box :admin 55 = f.check_box :admin
56 %span Administrator 56 %span Administrator
57 - unless @admin_user.new_record? 57 - unless @admin_user.new_record?
58 .alert.alert-error 58 .alert.alert-error
59 - if @admin_user.blocked 59 - if @admin_user.blocked
60 %span 60 %span
61 - = link_to 'Unblock', unblock_admin_user_path(@admin_user), :method => :put, :class => "btn small" 61 + = link_to 'Unblock', unblock_admin_user_path(@admin_user), method: :put, class: "btn small"
62 This user is blocked and is not able to login to GitLab 62 This user is blocked and is not able to login to GitLab
63 - else 63 - else
64 %span 64 %span
65 - = link_to 'Block', block_admin_user_path(@admin_user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger" 65 + = link_to 'Block', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
66 Blocked users will be removed from all projects &amp; will not be able to login to GitLab. 66 Blocked users will be removed from all projects &amp; will not be able to login to GitLab.
67 .actions 67 .actions
68 - = f.submit 'Save', :class => "btn primary" 68 + = f.submit 'Save', class: "btn primary"
69 - if @admin_user.new_record? 69 - if @admin_user.new_record?
70 - = link_to 'Cancel', admin_users_path, :class => "btn" 70 + = link_to 'Cancel', admin_users_path, class: "btn"
71 - else 71 - else
72 - = link_to 'Cancel', admin_user_path(@admin_user), :class => "btn" 72 + = link_to 'Cancel', admin_user_path(@admin_user), class: "btn"
app/views/admin/users/index.html.haml
1 %h3 1 %h3
2 Users 2 Users
3 - = link_to 'New User', new_admin_user_path, :class => "btn small right" 3 + = link_to 'New User', new_admin_user_path, class: "btn small right"
4 %br 4 %br
5 5
6 -= form_tag admin_users_path, :method => :get do  
7 - = text_field_tag :name, params[:name], :class => "xlarge"  
8 - = submit_tag "Search", :class => "btn submit primary" 6 += form_tag admin_users_path, method: :get do
  7 + = text_field_tag :name, params[:name], class: "xlarge"
  8 + = submit_tag "Search", class: "btn submit primary"
9 %ul.nav.nav-pills 9 %ul.nav.nav-pills
10 - %li{:class => "#{'active' unless params[:filter]}"} 10 + %li{class: "#{'active' unless params[:filter]}"}
11 = link_to "Active", admin_users_path 11 = link_to "Active", admin_users_path
12 - %li{:class => "#{'active' if params[:filter] == "admins"}"}  
13 - = link_to admin_users_path(:filter => "admins") do 12 + %li{class: "#{'active' if params[:filter] == "admins"}"}
  13 + = link_to admin_users_path(filter: "admins") do
14 Admins 14 Admins
15 - %li{:class => "#{'active' if params[:filter] == "blocked"}"}  
16 - = link_to admin_users_path(:filter => "blocked") do 15 + %li{class: "#{'active' if params[:filter] == "blocked"}"}
  16 + = link_to admin_users_path(filter: "blocked") do
17 Blocked 17 Blocked
18 - %li{:class => "#{'active' if params[:filter] == "wop"}"}  
19 - = link_to admin_users_path(:filter => "wop") do 18 + %li{class: "#{'active' if params[:filter] == "wop"}"}
  19 + = link_to admin_users_path(filter: "wop") do
20 Without projects 20 Without projects
21 21
22 %table.admin-table 22 %table.admin-table
@@ -31,16 +31,16 @@ @@ -31,16 +31,16 @@
31 31
32 - @admin_users.each do |user| 32 - @admin_users.each do |user|
33 %tr 33 %tr
34 - %td= check_box_tag "admin", 1, user.admin, :disabled => :disabled 34 + %td= check_box_tag "admin", 1, user.admin, disabled: :disabled
35 %td= link_to user.name, [:admin, user] 35 %td= link_to user.name, [:admin, user]
36 %td= user.email 36 %td= user.email
37 %td= user.users_projects.count 37 %td= user.users_projects.count
38 - %td= link_to 'Edit', edit_admin_user_path(user), :id => "edit_#{dom_id(user)}", :class => "btn small" 38 + %td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small"
39 %td 39 %td
40 - if user.blocked 40 - if user.blocked
41 - = link_to 'Unblock', unblock_admin_user_path(user), :method => :put, :class => "btn small success" 41 + = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success"
42 - else 42 - else
43 - = link_to 'Block', block_admin_user_path(user), :confirm => 'USER WILL BE BLOCKED! Are you sure?', :method => :put, :class => "btn small danger"  
44 - %td.bgred= link_to 'Destroy', [:admin, user], :confirm => "USER #{user.name} WILL BE REMOVED! Are you sure?", :method => :delete, :class => "btn small danger" 43 + = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger"
  44 + %td.bgred= link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger"
45 45
46 -= paginate @admin_users, :theme => "admin" 46 += paginate @admin_users, theme: "admin"
app/views/admin/users/show.html.haml
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 %small Blocked 4 %small Blocked
5 - if @admin_user.admin 5 - if @admin_user.admin
6 %small Administrator 6 %small Administrator
7 - = link_to 'Edit', edit_admin_user_path(@admin_user), :class => "btn small right" 7 + = link_to 'Edit', edit_admin_user_path(@admin_user), class: "btn small right"
8 8
9 %br 9 %br
10 10
@@ -19,12 +19,12 @@ @@ -19,12 +19,12 @@
19 %td 19 %td
20 %b 20 %b
21 Admin: 21 Admin:
22 - %td= check_box_tag "admin", 1, @admin_user.admin, :disabled => :disabled 22 + %td= check_box_tag "admin", 1, @admin_user.admin, disabled: :disabled
23 %tr 23 %tr
24 %td 24 %td
25 %b 25 %b
26 Blocked: 26 Blocked:
27 - %td= check_box_tag "blocked", 1, @admin_user.blocked, :disabled => :disabled 27 + %td= check_box_tag "blocked", 1, @admin_user.blocked, disabled: :disabled
28 %tr 28 %tr
29 %td 29 %td
30 %b 30 %b
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 %br 56 %br
57 %h3 Add User to Projects 57 %h3 Add User to Projects
58 %br 58 %br
59 -= form_tag team_update_admin_user_path(@admin_user), :class => "bulk_import", :method => :put do 59 += form_tag team_update_admin_user_path(@admin_user), class: "bulk_import", method: :put do
60 %table.table-bordered 60 %table.table-bordered
61 %thead 61 %thead
62 %tr 62 %tr
@@ -64,14 +64,14 @@ @@ -64,14 +64,14 @@
64 %th Project Access: 64 %th Project Access:
65 65
66 %tr 66 %tr
67 - %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), :multiple => true  
68 - %td= select_tag :project_access, options_for_select(Project.access_options), :class => "project-access-select" 67 + %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name), multiple: true
  68 + %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select"
69 69
70 %tr 70 %tr
71 - %td= submit_tag 'Add', :class => "btn primary" 71 + %td= submit_tag 'Add', class: "btn primary"
72 %td 72 %td
73 Read more about project permissions 73 Read more about project permissions
74 - %strong= link_to "here", help_permissions_path, :class => "vlink" 74 + %strong= link_to "here", help_permissions_path, class: "vlink"
75 %br 75 %br
76 76
77 - if @admin_user.projects.present? 77 - if @admin_user.projects.present?
@@ -90,9 +90,9 @@ @@ -90,9 +90,9 @@
90 - project = tm.project 90 - project = tm.project
91 %tr 91 %tr
92 %td= link_to project.name, admin_project_path(project) 92 %td= link_to project.name, admin_project_path(project)
93 - %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), :class => "medium project-access-select", :disabled => :disabled  
94 - %td= link_to 'Edit Access', edit_admin_team_member_path(tm), :class => "btn small"  
95 - %td= link_to 'Remove from team', admin_team_member_path(tm), :confirm => 'Are you sure?', :method => :delete, :class => "btn small danger" 93 + %td= select_tag :tm_project_access, options_for_select(Project.access_options, tm.project_access), class: "medium project-access-select", disabled: :disabled
  94 + %td= link_to 'Edit Access', edit_admin_team_member_path(tm), class: "btn small"
  95 + %td= link_to 'Remove from team', admin_team_member_path(tm), confirm: 'Are you sure?', method: :delete, class: "btn small danger"
96 96
97 :css 97 :css
98 form select { 98 form select {
app/views/commits/_commit.html.haml
1 %li.commit 1 %li.commit
2 .browse_code_link_holder 2 .browse_code_link_holder
3 %p 3 %p
4 - %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), :class => "right" 4 + %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right"
5 %p 5 %p
6 - = link_to commit.short_id(8), project_commit_path(@project, :id => commit.id), :class => "commit_short_id" 6 + = link_to commit.short_id(8), project_commit_path(@project, id: commit.id), class: "commit_short_id"
7 %strong.cgray= commit.author_name 7 %strong.cgray= commit.author_name
8 &ndash; 8 &ndash;
9 - = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16  
10 - = link_to_gfm truncate(commit.title, :length => 50), project_commit_path(@project, :id => commit.id), :class => "row_title" 9 + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
  10 + = link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title"
11 11
12 %span.committed_ago 12 %span.committed_ago
13 = time_ago_in_words(commit.committed_date) 13 = time_ago_in_words(commit.committed_date)
app/views/commits/_commit_box.html.haml
@@ -5,10 +5,10 @@ @@ -5,10 +5,10 @@
5 %span.btn.disabled.grouped 5 %span.btn.disabled.grouped
6 %i.icon-comment 6 %i.icon-comment
7 = @notes_count 7 = @notes_count
8 - = link_to patch_project_commit_path(@project, @commit.id), :class => "btn small grouped" do 8 + = link_to patch_project_commit_path(@project, @commit.id), class: "btn small grouped" do
9 %i.icon-download-alt 9 %i.icon-download-alt
10 Get Patch 10 Get Patch
11 - = link_to tree_project_ref_path(@project, @commit.id), :class => "browse-button primary grouped" do 11 + = link_to tree_project_ref_path(@project, @commit.id), class: "browse-button primary grouped" do
12 %strong Browse Code » 12 %strong Browse Code »
13 %h3.commit-title.page_title 13 %h3.commit-title.page_title
14 = gfm @commit.title 14 = gfm @commit.title
@@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
18 .commit-info 18 .commit-info
19 .row 19 .row
20 .span4 20 .span4
21 - = image_tag gravatar_icon(@commit.author_email, 40), :class => "avatar" 21 + = image_tag gravatar_icon(@commit.author_email, 40), class: "avatar"
22 .author 22 .author
23 %strong= @commit.author_name 23 %strong= @commit.author_name
24 authored 24 authored
app/views/commits/_diff_head.html.haml
@@ -3,24 +3,24 @@ @@ -3,24 +3,24 @@
3 %li 3 %li
4 - if diff.deleted_file 4 - if diff.deleted_file
5 %span.removed_file 5 %span.removed_file
6 - %a{:href => "##{diff.old_path}"} 6 + %a{href: "##{diff.old_path}"}
7 = diff.old_path 7 = diff.old_path
8 = image_tag "diff_file_delete.png" 8 = image_tag "diff_file_delete.png"
9 - elsif diff.renamed_file 9 - elsif diff.renamed_file
10 %span.moved_file 10 %span.moved_file
11 - %a{:href => "##{diff.new_path}"} 11 + %a{href: "##{diff.new_path}"}
12 = diff.old_path 12 = diff.old_path
13 = "->" 13 = "->"
14 = diff.new_path 14 = diff.new_path
15 = image_tag "diff_file_notice.png" 15 = image_tag "diff_file_notice.png"
16 - elsif diff.new_file 16 - elsif diff.new_file
17 %span.new_file 17 %span.new_file
18 - %a{:href => "##{diff.new_path}"} 18 + %a{href: "##{diff.new_path}"}
19 = diff.new_path 19 = diff.new_path
20 = image_tag "diff_file_add.png" 20 = image_tag "diff_file_add.png"
21 - else 21 - else
22 %span.edit_file 22 %span.edit_file
23 - %a{:href => "##{diff.new_path}"} 23 + %a{href: "##{diff.new_path}"}
24 = diff.new_path 24 = diff.new_path
25 = image_tag "diff_file_info.png" 25 = image_tag "diff_file_info.png"
26 26
app/views/commits/_diffs.html.haml
@@ -5,12 +5,12 @@ @@ -5,12 +5,12 @@
5 %p To prevent performance issue we rejected diff information. 5 %p To prevent performance issue we rejected diff information.
6 %p 6 %p
7 But if you still want to see diff 7 But if you still want to see diff
8 - = link_to "click this link", project_commit_path(@project, @commit.id, :force_show_diff => true), :class => "dark" 8 + = link_to "click this link", project_commit_path(@project, @commit.id, force_show_diff: true), class: "dark"
9 9
10 %p.cgray 10 %p.cgray
11 Showing #{pluralize(diffs.count, "changed file")} 11 Showing #{pluralize(diffs.count, "changed file")}
12 .file_stats 12 .file_stats
13 - = render "commits/diff_head", :diffs => diffs 13 + = render "commits/diff_head", diffs: diffs
14 14
15 - unless @suppress_diff 15 - unless @suppress_diff
16 - diffs.each_with_index do |diff, i| 16 - diffs.each_with_index do |diff, i|
@@ -22,26 +22,26 @@ @@ -22,26 +22,26 @@
22 .diff_file_header 22 .diff_file_header
23 - if diff.deleted_file 23 - if diff.deleted_file
24 %i.icon-file 24 %i.icon-file
25 - %span{:id => "#{diff.old_path}"}= diff.old_path 25 + %span{id: "#{diff.old_path}"}= diff.old_path
26 - else 26 - else
27 = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do 27 = link_to tree_file_project_ref_path(@project, @commit.id, diff.new_path) do
28 %i.icon-file 28 %i.icon-file
29 - %span{:id => "#{diff.new_path}"}= diff.new_path 29 + %span{id: "#{diff.new_path}"}= diff.new_path
30 %br/ 30 %br/
31 .diff_file_content 31 .diff_file_content
32 -# Skipp all non non-supported blobs 32 -# Skipp all non non-supported blobs
33 - next unless file.respond_to?('text?') 33 - next unless file.respond_to?('text?')
34 34
35 - if file.text? 35 - if file.text?
36 - = render "commits/text_file", :diff => diff, :index => i 36 + = render "commits/text_file", diff: diff, index: i
37 - elsif file.image? 37 - elsif file.image?
38 - if diff.renamed_file || diff.new_file || diff.deleted_file 38 - if diff.renamed_file || diff.new_file || diff.deleted_file
39 .diff_file_content_image 39 .diff_file_content_image
40 - %img{:class => image_diff_class(diff), :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} 40 + %img{class: image_diff_class(diff), src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
41 - else 41 - else
42 - old_file = (@commit.prev_commit.tree / diff.old_path) 42 - old_file = (@commit.prev_commit.tree / diff.old_path)
43 .diff_file_content_image.img_compared 43 .diff_file_content_image.img_compared
44 - %img{:class => "diff_image_removed", :src => "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}  
45 - %img{:class => "diff_image_added", :src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} 44 + %img{class: "diff_image_removed", src: "data:#{file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
  45 + %img{class: "diff_image_added", src: "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"}
46 - else 46 - else
47 %p.nothing_here_message No preview for this file type 47 %p.nothing_here_message No preview for this file type
app/views/commits/_head.html.haml
1 %ul.nav.nav-tabs 1 %ul.nav.nav-tabs
2 %li 2 %li
3 - = form_tag switch_project_refs_path(@project), :method => :get, :class => "project-refs-form" do  
4 - = select_tag "ref", grouped_options_refs, :onchange => "$(this.form).trigger('submit');", :class => "project-refs-select" 3 + = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do
  4 + = select_tag "ref", grouped_options_refs, onchange: "$(this.form).trigger('submit');", class: "project-refs-select"
5 = hidden_field_tag :destination, "commits" 5 = hidden_field_tag :destination, "commits"
6 6
7 - %li{:class => "#{'active' if current_page?(project_commits_path(@project)) }"} 7 + %li{class: "#{'active' if current_page?(project_commits_path(@project)) }"}
8 = link_to project_commits_path(@project) do 8 = link_to project_commits_path(@project) do
9 Commits 9 Commits
10 - %li{:class => "#{'active' if current_page?(compare_project_commits_path(@project)) }"} 10 + %li{class: "#{'active' if current_page?(compare_project_commits_path(@project)) }"}
11 = link_to compare_project_commits_path(@project) do 11 = link_to compare_project_commits_path(@project) do
12 Compare 12 Compare
13 - %li{:class => "#{branches_tab_class}"} 13 + %li{class: "#{branches_tab_class}"}
14 = link_to project_repository_path(@project) do 14 = link_to project_repository_path(@project) do
15 Branches 15 Branches
16 %span.badge= @project.repo.branch_count 16 %span.badge= @project.repo.branch_count
17 17
18 - %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"} 18 + %li{class: "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
19 = link_to tags_project_repository_path(@project) do 19 = link_to tags_project_repository_path(@project) do
20 Tags 20 Tags
21 %span.badge= @project.repo.tag_count 21 %span.badge= @project.repo.tag_count
@@ -24,8 +24,8 @@ @@ -24,8 +24,8 @@
24 - if current_page?(project_commits_path(@project)) && current_user.private_token 24 - if current_page?(project_commits_path(@project)) && current_user.private_token
25 %li.right 25 %li.right
26 %span.rss-icon 26 %span.rss-icon
27 - = link_to project_commits_path(@project, :atom, { :private_token => current_user.private_token, :ref => @ref }), :title => "Feed" do  
28 - = image_tag "rss_ui.png", :title => "feed" 27 + = link_to project_commits_path(@project, :atom, { private_token: current_user.private_token, ref: @ref }), title: "Feed" do
  28 + = image_tag "rss_ui.png", title: "feed"
29 29
30 :javascript 30 :javascript
31 $(function(){ 31 $(function(){
app/views/commits/_text_file.html.haml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 - if too_big 2 - if too_big
3 %a.supp_diff_link Diff suppressed. Click to show 3 %a.supp_diff_link Diff suppressed. Click to show
4 4
5 -%table{:class => "#{'hide' if too_big}"} 5 +%table{class: "#{'hide' if too_big}"}
6 - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| 6 - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|
7 %tr.line_holder 7 %tr.line_holder
8 - if type == "match" 8 - if type == "match"
@@ -11,16 +11,16 @@ @@ -11,16 +11,16 @@
11 %td.line_content.matched= line 11 %td.line_content.matched= line
12 - else 12 - else
13 %td.old_line 13 %td.old_line
14 - = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", :id => line_code 14 + = link_to raw(type == "new" ? "&nbsp;" : line_old), "##{line_code}", id: line_code
15 - if @comments_allowed 15 - if @comments_allowed
16 - = link_to "", "#", :class => "line_note_link", "line_code" => line_code, :title => "Add note for this line"  
17 - %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", :id => line_code  
18 - %td.line_content{:class => "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;" 16 + = link_to "", "#", class: "line_note_link", "line_code" => line_code, title: "Add note for this line"
  17 + %td.new_line= link_to raw(type == "old" ? "&nbsp;" : line_new) , "##{line_code}", id: line_code
  18 + %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
19 19
20 - if @comments_allowed 20 - if @comments_allowed
21 - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse 21 - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse
22 - unless comments.empty? 22 - unless comments.empty?
23 - comments.each_with_index do |note, i| 23 - comments.each_with_index do |note, i|
24 - = render "notes/reply_button", :line_code => line_code if i.zero?  
25 - = render "notes/per_line_show", :note => note 24 + = render "notes/reply_button", line_code: line_code if i.zero?
  25 + = render "notes/per_line_show", note: note
26 - @line_notes.reject!{ |n| n == note } 26 - @line_notes.reject!{ |n| n == note }
app/views/commits/compare.html.haml
@@ -14,13 +14,13 @@ @@ -14,13 +14,13 @@
14 14
15 %br 15 %br
16 16
17 - = form_tag compare_project_commits_path(@project), :method => :get do 17 + = form_tag compare_project_commits_path(@project), method: :get do
18 .clearfix 18 .clearfix
19 - = text_field_tag :from, params[:from], :placeholder => "master", :class => "xlarge" 19 + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge"
20 = "..." 20 = "..."
21 - = text_field_tag :to, params[:to], :placeholder => "aa8b4ef", :class => "xlarge" 21 + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge"
22 .actions 22 .actions
23 - = submit_tag "Compare", :class => "btn btn-primary" 23 + = submit_tag "Compare", class: "btn btn-primary"
24 24
25 25
26 - unless @commits.empty? 26 - unless @commits.empty?
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 30
31 - unless @diffs.empty? 31 - unless @diffs.empty?
32 %h4 Diff 32 %h4 Diff
33 - = render "commits/diffs", :diffs => @diffs 33 + = render "commits/diffs", diffs: @diffs
34 34
35 :javascript 35 :javascript
36 $(function() { 36 $(function() {
app/views/commits/index.html.haml
@@ -9,12 +9,12 @@ @@ -9,12 +9,12 @@
9 %span.divider 9 %span.divider
10 \/ 10 \/
11 %li 11 %li
12 - %a{:href => "#"}= params[:path].split("/").join(" / ") 12 + %a{href: "#"}= params[:path].split("/").join(" / ")
13 13
14 -%div{:id => dom_id(@project)} 14 +%div{id: dom_id(@project)}
15 #commits_list= render "commits" 15 #commits_list= render "commits"
16 .clear 16 .clear
17 -.loading{ :style => "display:none;"} 17 +.loading{ style: "display:none;"}
18 18
19 - if @commits.count == @limit 19 - if @commits.count == @limit
20 :javascript 20 :javascript
app/views/commits/index.js.haml
1 :plain 1 :plain
2 - CommitsList.append(#{@commits.count}, "#{escape_javascript(render(:partial => 'commits/commits'))}"); 2 + CommitsList.append(#{@commits.count}, "#{escape_javascript(render(partial: 'commits/commits'))}");
3 3
app/views/commits/show.html.haml
1 = render "commits/commit_box" 1 = render "commits/commit_box"
2 -= render "commits/diffs", :diffs => @commit.diffs  
3 -= render "notes/notes", :tid => @commit.id, :tt => "commit" 2 += render "commits/diffs", diffs: @commit.diffs
  3 += render "notes/notes", tid: @commit.id, tt: "commit"
4 = render "notes/per_line_form" 4 = render "notes/per_line_form"
5 5
6 6
app/views/dashboard/index.html.haml
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 %span 6 %span
7 You wont be able to pull/push project code unless you 7 You wont be able to pull/push project code unless you
8 %strong 8 %strong
9 - = link_to new_key_path, :class => "vlink" do 9 + = link_to new_key_path, class: "vlink" do
10 add new key 10 add new key
11 to your profile 11 to your profile
12 - if @events.any? 12 - if @events.any?
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 %h4.nothing_here_message Projects activity will be displayed here 15 %h4.nothing_here_message Projects activity will be displayed here
16 .loading.hide 16 .loading.hide
17 .side 17 .side
18 - = render "events/event_last_push", :event => @last_push 18 + = render "events/event_last_push", event: @last_push
19 .projects_box 19 .projects_box
20 %h5 20 %h5
21 Projects 21 Projects
@@ -23,23 +23,23 @@ @@ -23,23 +23,23 @@
23 (#{@projects.total_count}) 23 (#{@projects.total_count})
24 - if current_user.can_create_project? 24 - if current_user.can_create_project?
25 %span.right 25 %span.right
26 - = link_to new_project_path, :class => "btn very_small info" do 26 + = link_to new_project_path, class: "btn very_small info" do
27 %i.icon-plus 27 %i.icon-plus
28 New Project 28 New Project
29 - @projects.each do |project| 29 - @projects.each do |project|
30 - = link_to project_path(project), :class => dom_class(project) do 30 + = link_to project_path(project), class: dom_class(project) do
31 %h4 31 %h4
32 %span.ico.project 32 %span.ico.project
33 - = truncate(project.name, :length => 25) 33 + = truncate(project.name, length: 25)
34 %span.right 34 %span.right
35 &rarr; 35 &rarr;
36 - .bottom= paginate @projects, :theme => "gitlab" 36 + .bottom= paginate @projects, theme: "gitlab"
37 37
38 %hr 38 %hr
39 %div 39 %div
40 %span.rss-icon 40 %span.rss-icon
41 - = link_to dashboard_path(:atom, { :private_token => current_user.private_token }) do  
42 - = image_tag "rss_ui.png", :title => "feed" 41 + = link_to dashboard_path(:atom, { private_token: current_user.private_token }) do
  42 + = image_tag "rss_ui.png", title: "feed"
43 %strong News Feed 43 %strong News Feed
44 44
45 - else 45 - else
@@ -51,7 +51,7 @@ @@ -51,7 +51,7 @@
51 = current_user.projects_limit 51 = current_user.projects_limit
52 projects. Click on button below to add a new one 52 projects. Click on button below to add a new one
53 .link_holder 53 .link_holder
54 - = link_to new_project_path, :class => "btn primary" do 54 + = link_to new_project_path, class: "btn primary" do
55 New Project » 55 New Project »
56 - else 56 - else
57 If you will be added to project - it will be displayed here 57 If you will be added to project - it will be displayed here
app/views/dashboard/issues.html.haml
@@ -12,8 +12,8 @@ @@ -12,8 +12,8 @@
12 %h5= @project.name 12 %h5= @project.name
13 %ul.unstyled.issues_table 13 %ul.unstyled.issues_table
14 - group[1].each do |issue| 14 - group[1].each do |issue|
15 - = render(:partial => 'issues/show', :locals => {:issue => issue}) 15 + = render(partial: 'issues/show', locals: {issue: issue})
16 %hr 16 %hr
17 - = paginate @issues, :theme => "gitlab" 17 + = paginate @issues, theme: "gitlab"
18 - else 18 - else
19 %h3.nothing_here_message Nothing to show here 19 %h3.nothing_here_message Nothing to show here
app/views/dashboard/merge_requests.html.haml
@@ -10,9 +10,9 @@ @@ -10,9 +10,9 @@
10 - @project = group[0] 10 - @project = group[0]
11 %h5= @project.name 11 %h5= @project.name
12 - group[1].each do |merge_request| 12 - group[1].each do |merge_request|
13 - = render(:partial => 'merge_requests/merge_request', :locals => {:merge_request => merge_request}) 13 + = render(partial: 'merge_requests/merge_request', locals: {merge_request: merge_request})
14 %hr 14 %hr
15 - = paginate @merge_requests, :theme => "gitlab" 15 + = paginate @merge_requests, theme: "gitlab"
16 16
17 - else 17 - else
18 %h3.nothing_here_message Nothing to show here 18 %h3.nothing_here_message Nothing to show here
app/views/deploy_keys/_form.html.haml
1 %div 1 %div
2 - = form_for [@project, @key], :url => project_deploy_keys_path do |f| 2 + = form_for [@project, @key], url: project_deploy_keys_path do |f|
3 -if @key.errors.any? 3 -if @key.errors.any?
4 .alert-message.block-message.error 4 .alert-message.block-message.error
5 %ul 5 %ul
@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
11 .input= f.text_field :title 11 .input= f.text_field :title
12 .clearfix 12 .clearfix
13 = f.label :key 13 = f.label :key
14 - .input= f.text_area :key, :class => "xlarge" 14 + .input= f.text_area :key, class: "xlarge"
15 .actions 15 .actions
16 - = f.submit 'Save', :class => "primary btn"  
17 - = link_to "Cancel", project_deploy_keys_path(@project), :class => "btn" 16 + = f.submit 'Save', class: "primary btn"
  17 + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn"
18 18
app/views/deploy_keys/_show.html.haml
1 %tr 1 %tr
2 %td 2 %td
3 - %a{:href => project_deploy_key_path(key.project, key)} 3 + %a{href: project_deploy_key_path(key.project, key)}
4 %strong= key.title 4 %strong= key.title
5 %td 5 %td
6 %span.update-author 6 %span.update-author
@@ -8,5 +8,5 @@ @@ -8,5 +8,5 @@
8 = time_ago_in_words(key.created_at) 8 = time_ago_in_words(key.created_at)
9 ago 9 ago
10 %td 10 %td
11 - = link_to 'Remove', project_deploy_key_path(key.project, key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key small right" 11 + = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key small right"
12 12
app/views/deploy_keys/index.html.haml
@@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
2 - if can? current_user, :admin_project, @project 2 - if can? current_user, :admin_project, @project
3 .alert-message.block-message 3 .alert-message.block-message
4 Deploy keys allow read-only access to repository. 4 Deploy keys allow read-only access to repository.
5 - = link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do 5 + = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do
6 Add Deploy Key 6 Add Deploy Key
7 7
8 - if @keys.any? 8 - if @keys.any?
9 %table 9 %table
10 - @keys.each do |key| 10 - @keys.each do |key|
11 - = render(:partial => 'show', :locals => {:key => key}) 11 + = render(partial: 'show', locals: {key: key})
app/views/deploy_keys/show.html.haml
@@ -3,5 +3,5 @@ @@ -3,5 +3,5 @@
3 %hr 3 %hr
4 %pre= @key.key 4 %pre= @key.key
5 .actions 5 .actions
6 - = link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key" 6 + = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key"
7 .clear 7 .clear
app/views/devise/passwords/edit.html.haml
1 -= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put, :class => "login-box" }) do |f|  
2 - = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" 1 += form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f|
  2 + = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo"
3 %h3 Change your password 3 %h3 Change your password
4 = devise_error_messages! 4 = devise_error_messages!
5 = f.hidden_field :reset_password_token 5 = f.hidden_field :reset_password_token
6 %div 6 %div
7 - = f.password_field :password, :class => "text top", :placeholder => "New password" 7 + = f.password_field :password, class: "text top", placeholder: "New password"
8 %div 8 %div
9 - = f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm new password" 9 + = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password"
10 %div 10 %div
11 - = f.submit "Change my password", :class => "btn primary"  
12 - .right= render :partial => "devise/shared/links" 11 + = f.submit "Change my password", class: "btn primary"
  12 + .right= render partial: "devise/shared/links"
app/views/errors/access_denied.html.haml
@@ -2,4 +2,4 @@ @@ -2,4 +2,4 @@
2 %h3 Access Denied 2 %h3 Access Denied
3 %hr 3 %hr
4 %p Youre not allowed to access this page 4 %p Youre not allowed to access this page
5 - %p Read more about project permissions #{link_to "here", help_permissions_path, :class => "vlink"} 5 + %p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
app/views/events/_commit.html.haml
1 - commit = CommitDecorator.decorate(commit) 1 - commit = CommitDecorator.decorate(commit)
2 %li.wll.commit 2 %li.wll.commit
3 %p 3 %p
4 - = link_to commit.short_id(8), project_commit_path(project, :id => commit.id), :class => "commit_short_id" 4 + = link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id"
5 %strong.cdark= commit.author_name 5 %strong.cdark= commit.author_name
6 &ndash; 6 &ndash;
7 - = image_tag gravatar_icon(commit.author_email), :class => "avatar", :width => 16  
8 - = gfm truncate(commit.title, :length => 50), project_commit_path(project, :id => commit.id) rescue "--broken encoding" 7 + = image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
  8 + = gfm truncate(commit.title, length: 50), project_commit_path(project, id: commit.id) rescue "--broken encoding"
9 9
app/views/events/_event.html.haml
1 - if event.allowed? 1 - if event.allowed?
2 - if event.issue? 2 - if event.issue?
3 .event_feed 3 .event_feed
4 - = render "events/event_issue", :event => event 4 + = render "events/event_issue", event: event
5 5
6 - elsif event.merge_request? 6 - elsif event.merge_request?
7 .event_feed 7 .event_feed
8 - = render "events/event_merge_request", :event => event 8 + = render "events/event_merge_request", event: event
9 9
10 - elsif event.push? 10 - elsif event.push?
11 .event_feed 11 .event_feed
12 - = render "events/event_push", :event => event 12 + = render "events/event_push", event: event
13 13
app/views/events/_event_issue.html.haml
1 -= image_tag gravatar_icon(event.author_email), :class => "avatar" 1 += image_tag gravatar_icon(event.author_email), class: "avatar"
2 %strong #{event.author_name} 2 %strong #{event.author_name}
3 -%span.event_label{:class => event.action_name}= event.action_name 3 +%span.event_label{class: event.action_name}= event.action_name
4 issue 4 issue
5 = link_to project_issue_path(event.project, event.issue) do 5 = link_to project_issue_path(event.project, event.issue) do
6 %strong= truncate event.issue_title 6 %strong= truncate event.issue_title
app/views/events/_event_last_push.html.haml
1 - if show_last_push_widget?(event) 1 - if show_last_push_widget?(event)
2 .event_lp 2 .event_lp
3 %div 3 %div
4 - = image_tag gravatar_icon(event.author_email), :class => "avatar" 4 + = image_tag gravatar_icon(event.author_email), class: "avatar"
5 %span Your pushed to 5 %span Your pushed to
6 = event.ref_type 6 = event.ref_type
7 - = link_to project_commits_path(event.project, :ref => event.ref_name) do  
8 - %strong= truncate(event.ref_name, :length => 28) 7 + = link_to project_commits_path(event.project, ref: event.ref_name) do
  8 + %strong= truncate(event.ref_name, length: 28)
9 at 9 at
10 %strong= link_to event.project.name, event.project 10 %strong= link_to event.project.name, event.project
11 11
12 - = link_to new_mr_path_from_push_event(event), :title => "New Merge Request", :class => "btn very_small primary" do 12 + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn very_small primary" do
13 Create Merge Request 13 Create Merge Request
app/views/events/_event_merge_request.html.haml
1 - if event.action_name == "merged" 1 - if event.action_name == "merged"
2 .event_icon= image_tag "event_mr_merged.png" 2 .event_icon= image_tag "event_mr_merged.png"
3 -= image_tag gravatar_icon(event.author_email), :class => "avatar" 3 += image_tag gravatar_icon(event.author_email), class: "avatar"
4 %strong #{event.author_name} 4 %strong #{event.author_name}
5 -%span.event_label{:class => event.action_name}= event.action_name 5 +%span.event_label{class: event.action_name}= event.action_name
6 merge request 6 merge request
7 = link_to project_merge_request_path(event.project, event.merge_request) do 7 = link_to project_merge_request_path(event.project, event.merge_request) do
8 %strong= truncate event.merge_request_title 8 %strong= truncate event.merge_request_title
app/views/events/_event_push.html.haml
1 %div 1 %div
2 .event_icon= image_tag "event_push.png" 2 .event_icon= image_tag "event_push.png"
3 - = image_tag gravatar_icon(event.author_email), :class => "avatar" 3 + = image_tag gravatar_icon(event.author_email), class: "avatar"
4 %strong #{event.author_name} 4 %strong #{event.author_name}
5 %span.event_label.pushed= event.push_action_name 5 %span.event_label.pushed= event.push_action_name
6 = event.ref_type 6 = event.ref_type
7 - = link_to project_commits_path(event.project, :ref => event.ref_name) do 7 + = link_to project_commits_path(event.project, ref: event.ref_name) do
8 %strong= event.ref_name 8 %strong= event.ref_name
9 at 9 at
10 %strong= link_to event.project.name, event.project 10 %strong= link_to event.project.name, event.project
@@ -14,17 +14,17 @@ @@ -14,17 +14,17 @@
14 14
15 - if event.push_with_commits? 15 - if event.push_with_commits?
16 - if event.commits_count > 1 16 - if event.commits_count > 1
17 - = link_to compare_project_commits_path(event.project, :from => event.parent_commit.id, :to => event.last_commit.id) do 17 + = link_to compare_project_commits_path(event.project, from: event.parent_commit.id, to: event.last_commit.id) do
18 %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]} 18 %strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
19 - project = event.project 19 - project = event.project
20 %ul.unstyled.event_commits 20 %ul.unstyled.event_commits
21 - if event.commits_count > 3 21 - if event.commits_count > 3
22 - event.commits[0...2].each do |commit| 22 - event.commits[0...2].each do |commit|
23 - = render "events/commit", :commit => commit, :project => project 23 + = render "events/commit", commit: commit, project: project
24 %li 24 %li
25 %br 25 %br
26 \... and #{event.commits_count - 2} more commits 26 \... and #{event.commits_count - 2} more commits
27 - else 27 - else
28 - event.commits.each do |commit| 28 - event.commits.each do |commit|
29 - = render "events/commit", :commit => commit, :project => project 29 + = render "events/commit", commit: commit, project: project
30 30
app/views/help/api.html.haml
@@ -6,13 +6,13 @@ @@ -6,13 +6,13 @@
6 6
7 %ol 7 %ol
8 %li 8 %li
9 - %a{:href => "#README"} README 9 + %a{href: "#README"} README
10 %li 10 %li
11 - %a{:href => "#projects"} Projects 11 + %a{href: "#projects"} Projects
12 %li 12 %li
13 - %a{:href => "#users"} Users 13 + %a{href: "#users"} Users
14 %li 14 %li
15 - %a{:href => "#issues"} Issues 15 + %a{href: "#issues"} Issues
16 16
17 .file_holder#README 17 .file_holder#README
18 .file_title 18 .file_title
app/views/hooks/index.html.haml
@@ -6,9 +6,9 @@ @@ -6,9 +6,9 @@
6 Post receive hooks for binding events when someone push to repository. 6 Post receive hooks for binding events when someone push to repository.
7 %br 7 %br
8 Read more about web hooks 8 Read more about web hooks
9 - %strong #{link_to "here", help_web_hooks_path, :class => "vlink"} 9 + %strong #{link_to "here", help_web_hooks_path, class: "vlink"}
10 10
11 -= form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f| 11 += form_for [@project, @hook], as: :hook, url: project_hooks_path(@project) do |f|
12 -if @hook.errors.any? 12 -if @hook.errors.any?
13 .alert-message.block-message.error 13 .alert-message.block-message.error
14 - @hook.errors.full_messages.each do |msg| 14 - @hook.errors.full_messages.each do |msg|
@@ -16,9 +16,9 @@ @@ -16,9 +16,9 @@
16 .clearfix 16 .clearfix
17 = f.label :url, "URL:" 17 = f.label :url, "URL:"
18 .input 18 .input
19 - = f.text_field :url, :class => "text_field xxlarge" 19 + = f.text_field :url, class: "text_field xxlarge"
20 &nbsp; 20 &nbsp;
21 - = f.submit "Add Web Hook", :class => "btn primary" 21 + = f.submit "Add Web Hook", class: "btn primary"
22 %hr 22 %hr
23 23
24 -if @hooks.any? 24 -if @hooks.any?
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 %td 36 %td
37 = link_to project_hook_path(@project, hook) do 37 = link_to project_hook_path(@project, hook) do
38 %strong= hook.url 38 %strong= hook.url
39 - = link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right" 39 + = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small right"
40 %td POST 40 %td POST
41 %td 41 %td
42 - = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" 42 + = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right"
app/views/issues/_form.html.haml
1 %div.issue-form-holder 1 %div.issue-form-holder
2 %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" 2 %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
3 - = form_for [@project, @issue], :remote => request.xhr? do |f| 3 + = form_for [@project, @issue], remote: request.xhr? do |f|
4 -if @issue.errors.any? 4 -if @issue.errors.any?
5 .alert-message.block-message.error 5 .alert-message.block-message.error
6 %ul 6 %ul
@@ -12,18 +12,18 @@ @@ -12,18 +12,18 @@
12 = f.label :title do 12 = f.label :title do
13 %strong= "Subject *" 13 %strong= "Subject *"
14 .input 14 .input
15 - = f.text_field :title, :maxlength => 255, :class => "xxlarge" 15 + = f.text_field :title, maxlength: 255, class: "xxlarge"
16 .issue_middle_block 16 .issue_middle_block
17 .issue_assignee 17 .issue_assignee
18 = f.label :assignee_id do 18 = f.label :assignee_id do
19 %i.icon-user 19 %i.icon-user
20 Assign to 20 Assign to
21 - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select a user" }) 21 + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { include_blank: "Select a user" })
22 .issue_milestone 22 .issue_milestone
23 = f.label :milestone_id do 23 = f.label :milestone_id do
24 %i.icon-time 24 %i.icon-time
25 Milestone 25 Milestone
26 - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" }) 26 + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" })
27 27
28 .issue_description 28 .issue_description
29 .clearfix 29 .clearfix
@@ -31,26 +31,26 @@ @@ -31,26 +31,26 @@
31 %i.icon-tag 31 %i.icon-tag
32 Labels 32 Labels
33 .input 33 .input
34 - = f.text_field :label_list, :maxlength => 2000, :class => "xxlarge" 34 + = f.text_field :label_list, maxlength: 2000, class: "xxlarge"
35 %p.hint Separate with comma. 35 %p.hint Separate with comma.
36 36
37 .clearfix 37 .clearfix
38 = f.label :description, "Details" 38 = f.label :description, "Details"
39 .input 39 .input
40 - = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14 40 + = f.text_area :description, maxlength: 2000, class: "xxlarge", rows: 14
41 %p.hint Markdown is enabled. 41 %p.hint Markdown is enabled.
42 42
43 43
44 .actions 44 .actions
45 - if @issue.new_record? 45 - if @issue.new_record?
46 - = f.submit 'Submit new issue', :class => "primary btn" 46 + = f.submit 'Submit new issue', class: "primary btn"
47 -else 47 -else
48 - = f.submit 'Save changes', :class => "primary btn" 48 + = f.submit 'Save changes', class: "primary btn"
49 49
50 - if request.xhr? 50 - if request.xhr?
51 - = link_to "Cancel", "#back", :onclick => "backToIssues();", :class => "btn" 51 + = link_to "Cancel", "#back", onclick: "backToIssues();", class: "btn"
52 - else 52 - else
53 - if @issue.new_record? 53 - if @issue.new_record?
54 - = link_to "Cancel", project_issues_path(@project), :class => "btn" 54 + = link_to "Cancel", project_issues_path(@project), class: "btn"
55 - else 55 - else
56 - = link_to "Cancel", project_issue_path(@project, @issue), :class => "btn" 56 + = link_to "Cancel", project_issue_path(@project, @issue), class: "btn"
app/views/issues/_head.html.haml
1 %ul.nav.nav-tabs 1 %ul.nav.nav-tabs
2 - %li{:class => "#{'active' if current_page?(project_issues_path(@project))}"}  
3 - = link_to project_issues_path(@project), :class => "tab" do 2 + %li{class: "#{'active' if current_page?(project_issues_path(@project))}"}
  3 + = link_to project_issues_path(@project), class: "tab" do
4 Browse Issues 4 Browse Issues
5 - %li{:class => "#{'active' if current_page?(project_milestones_path(@project))}"}  
6 - = link_to project_milestones_path(@project), :class => "tab" do 5 + %li{class: "#{'active' if current_page?(project_milestones_path(@project))}"}
  6 + = link_to project_milestones_path(@project), class: "tab" do
7 Milestones 7 Milestones
8 %li.right 8 %li.right
9 %span.rss-icon 9 %span.rss-icon
10 - = link_to project_issues_path(@project, :atom, { :private_token => current_user.private_token }) do  
11 - = image_tag "rss_ui.png", :title => "feed" 10 + = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do
  11 + = image_tag "rss_ui.png", title: "feed"
app/views/issues/_issues.html.haml
1 - @issues.each do |issue| 1 - @issues.each do |issue|
2 - = render(:partial => 'issues/show', :locals => {:issue => issue}) 2 + = render(partial: 'issues/show', locals: {issue: issue})
3 3
4 - if @issues.present? 4 - if @issues.present?
5 %li.bottom 5 %li.bottom
6 .row 6 .row
7 - .span7= paginate @issues, :remote => true, :theme => "gitlab" 7 + .span7= paginate @issues, remote: true, theme: "gitlab"
8 .span3.right 8 .span3.right
9 %span.cgray.right 9 %span.cgray.right
10 %span.issue_counter #{@issues.total_count} 10 %span.issue_counter #{@issues.total_count}
app/views/issues/_show.html.haml
1 -%li.wll{ :id => dom_id(issue), :class => issue_css_classes(issue), :url => project_issue_path(issue.project, issue) } 1 +%li.wll{ id: dom_id(issue), class: issue_css_classes(issue), url: project_issue_path(issue.project, issue) }
2 - if controller.controller_name == 'issues' 2 - if controller.controller_name == 'issues'
3 .issue_check 3 .issue_check
4 - = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, :class => "selected_issue", :disabled => !can?(current_user, :modify_issue, issue) 4 + = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue)
5 .right 5 .right
6 - issue.labels.each do |label| 6 - issue.labels.each do |label|
7 %span.label.label-issue.grouped 7 %span.label.label-issue.grouped
@@ -13,19 +13,19 @@ @@ -13,19 +13,19 @@
13 = issue.notes.count 13 = issue.notes.count
14 - if can? current_user, :modify_issue, issue 14 - if can? current_user, :modify_issue, issue
15 - if issue.closed 15 - if issue.closed
16 - = link_to 'Reopen', project_issue_path(issue.project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small grouped reopen_issue", :remote => true 16 + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small grouped reopen_issue", remote: true
17 - else 17 - else
18 - = link_to 'Resolve', project_issue_path(issue.project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "success btn small grouped close_issue", :remote => true  
19 - = link_to edit_project_issue_path(issue.project, issue), :class => "btn small edit-issue-link", :remote => true do 18 + = link_to 'Resolve', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "success btn small grouped close_issue", remote: true
  19 + = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link", remote: true do
20 %i.icon-edit 20 %i.icon-edit
21 Edit 21 Edit
22 22
23 - if issue.assignee 23 - if issue.assignee
24 - = image_tag gravatar_icon(issue.assignee_email), :class => "avatar" 24 + = image_tag gravatar_icon(issue.assignee_email), class: "avatar"
25 - else 25 - else
26 - = image_tag "no_avatar.png", :class => "avatar" 26 + = image_tag "no_avatar.png", class: "avatar"
27 27
28 - %p= link_to_gfm truncate(issue.title, :length => 100), project_issue_path(issue.project, issue), :class => "row_title" 28 + %p= link_to_gfm truncate(issue.title, length: 100), project_issue_path(issue.project, issue), class: "row_title"
29 29
30 %span.update-author 30 %span.update-author
31 %small.cdark= "##{issue.id}" 31 %small.cdark= "##{issue.id}"
app/views/issues/create.js.haml
1 - if @issue.valid? 1 - if @issue.valid?
2 :plain 2 :plain
3 switchFromNewIssue(); 3 switchFromNewIssue();
4 - $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue}))}"); 4 + $("#issues-table").prepend("#{escape_javascript(render(partial: 'show', locals: {issue: @issue}))}");
5 $.ajax({type: "GET", url: location.href, dataType: "script"}); 5 $.ajax({type: "GET", url: location.href, dataType: "script"});
6 - else 6 - else
7 :plain 7 :plain
app/views/issues/index.html.haml
@@ -6,51 +6,51 @@ @@ -6,51 +6,51 @@
6 .right 6 .right
7 .span5 7 .span5
8 - if can? current_user, :write_issue, @project 8 - if can? current_user, :write_issue, @project
9 - = link_to new_project_issue_path(@project), :class => "right btn small", :title => "New Issue", :remote => true do 9 + = link_to new_project_issue_path(@project), class: "right btn small", title: "New Issue", remote: true do
10 New Issue 10 New Issue
11 - = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :id => "issue_search_form", :class => :right do  
12 - = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } 11 + = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do
  12 + = hidden_field_tag :project_id, @project.id, { id: 'project_id' }
13 = hidden_field_tag :status, params[:f] 13 = hidden_field_tag :status, params[:f]
14 - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search span3 right neib' } 14 + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib' }
15 15
16 .clearfix 16 .clearfix
17 17
18 %div#issues-table-holder.ui-box 18 %div#issues-table-holder.ui-box
19 .title 19 .title
20 - = check_box_tag "check_all_issues", nil, false, :class => "check_all_issues left" 20 + = check_box_tag "check_all_issues", nil, false, class: "check_all_issues left"
21 21
22 22
23 .issues_bulk_update.hide 23 .issues_bulk_update.hide
24 - = form_tag bulk_update_project_issues_path(@project), :method => :post do 24 + = form_tag bulk_update_project_issues_path(@project), method: :post do
25 %span.update_issues_text Update selected issues with &nbsp; 25 %span.update_issues_text Update selected issues with &nbsp;
26 .left 26 .left
27 - = select_tag('update[status]', options_for_select(['open', 'closed']), :prompt => "Status")  
28 - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee")  
29 - = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") 27 + = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status")
  28 + = select_tag('update[assignee_id]', options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
  29 + = select_tag('update[milestone_id]', options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
30 = hidden_field_tag 'update[issues_ids]', [] 30 = hidden_field_tag 'update[issues_ids]', []
31 = hidden_field_tag :f, params[:f] 31 = hidden_field_tag :f, params[:f]
32 - = button_tag "Save", :class => "btn update_selected_issues" 32 + = button_tag "Save", class: "btn update_selected_issues"
33 .issues_filters 33 .issues_filters
34 .left 34 .left
35 %ul.nav.nav-pills.left 35 %ul.nav.nav-pills.left
36 - %li{:class => ("active" if (params[:f] == issues_filter[:open] || !params[:f]))}  
37 - = link_to project_issues_path(@project, :f => issues_filter[:open], :milestone_id => params[:milestone_id]) do 36 + %li{class: ("active" if (params[:f] == issues_filter[:open] || !params[:f]))}
  37 + = link_to project_issues_path(@project, f: issues_filter[:open], milestone_id: params[:milestone_id]) do
38 Open 38 Open
39 - %li{:class => ("active" if params[:f] == issues_filter[:closed])}  
40 - = link_to project_issues_path(@project, :f => issues_filter[:closed], :milestone_id => params[:milestone_id]) do 39 + %li{class: ("active" if params[:f] == issues_filter[:closed])}
  40 + = link_to project_issues_path(@project, f: issues_filter[:closed], milestone_id: params[:milestone_id]) do
41 Closed 41 Closed
42 - %li{:class => ("active" if params[:f] == issues_filter[:to_me])}  
43 - = link_to project_issues_path(@project, :f => issues_filter[:to_me], :milestone_id => params[:milestone_id]) do 42 + %li{class: ("active" if params[:f] == issues_filter[:to_me])}
  43 + = link_to project_issues_path(@project, f: issues_filter[:to_me], milestone_id: params[:milestone_id]) do
44 To Me 44 To Me
45 - %li{:class => ("active" if params[:f] == issues_filter[:all])}  
46 - = link_to project_issues_path(@project, :f => issues_filter[:all], :milestone_id => params[:milestone_id]) do 45 + %li{class: ("active" if params[:f] == issues_filter[:all])}
  46 + = link_to project_issues_path(@project, f: issues_filter[:all], milestone_id: params[:milestone_id]) do
47 All 47 All
48 48
49 .right 49 .right
50 - = form_tag project_issues_path(@project), :method => :get, :class => :right do  
51 - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), :prompt => "Labels")  
52 - = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee")  
53 - = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone") 50 + = form_tag project_issues_path(@project), method: :get, class: :right do
  51 + = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
  52 + = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
  53 + = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
54 = hidden_field_tag :f, params[:f] 54 = hidden_field_tag :f, params[:f]
55 .clearfix 55 .clearfix
56 56
app/views/issues/show.html.haml
@@ -8,11 +8,11 @@ @@ -8,11 +8,11 @@
8 %span.right 8 %span.right
9 - if can?(current_user, :admin_project, @project) || @issue.author == current_user 9 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
10 - if @issue.closed 10 - if @issue.closed
11 - = link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small" 11 + = link_to 'Reopen', project_issue_path(@project, @issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small"
12 - else 12 - else
13 - = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn small", :title => "Close Issue" 13 + = link_to 'Close', project_issue_path(@project, @issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small", title: "Close Issue"
14 - if can?(current_user, :admin_project, @project) || @issue.author == current_user 14 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
15 - = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do 15 + = link_to edit_project_issue_path(@project, @issue), class: "btn small" do
16 %i.icon-edit 16 %i.icon-edit
17 Edit 17 Edit
18 18
@@ -35,18 +35,18 @@ @@ -35,18 +35,18 @@
35 35
36 .middle_box_content 36 .middle_box_content
37 %cite.cgray Created by 37 %cite.cgray Created by
38 - = image_tag gravatar_icon(@issue.author_email), :width => 16, :class => "lil_av" 38 + = image_tag gravatar_icon(@issue.author_email), width: 16, class: "lil_av"
39 %strong.author= link_to_issue_author(@issue) 39 %strong.author= link_to_issue_author(@issue)
40 40
41 - if @issue.assignee 41 - if @issue.assignee
42 %cite.cgray and currently assigned to 42 %cite.cgray and currently assigned to
43 - = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av" 43 + = image_tag gravatar_icon(@issue.assignee_email), width: 16, class: "lil_av"
44 %strong.author= link_to_issue_assignee(@issue) 44 %strong.author= link_to_issue_assignee(@issue)
45 45
46 - if @issue.milestone 46 - if @issue.milestone
47 - milestone = @issue.milestone 47 - milestone = @issue.milestone
48 %cite.cgray and attached to milestone 48 %cite.cgray and attached to milestone
49 - %strong= link_to_gfm truncate(milestone.title, :length => 20), project_milestone_path(milestone.project, milestone) 49 + %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)
50 50
51 .right 51 .right
52 - @issue.labels.each do |label| 52 - @issue.labels.each do |label|
@@ -61,4 +61,4 @@ @@ -61,4 +61,4 @@
61 = markdown @issue.description 61 = markdown @issue.description
62 62
63 63
64 -.issue_notes#notes= render "notes/notes", :tid => @issue.id, :tt => "issue" 64 +.issue_notes#notes= render "notes/notes", tid: @issue.id, tt: "issue"
app/views/kaminari/admin/_first_page.html.haml
@@ -6,4 +6,4 @@ @@ -6,4 +6,4 @@
6 -# per_page: number of items to fetch per page 6 -# per_page: number of items to fetch per page
7 -# remote: data-remote 7 -# remote: data-remote
8 %span.first 8 %span.first
9 - = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote 9 + = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote