Skip to content

Commit 76c4e83

Browse files
committed
Minore code-style fixes
1 parent 810d090 commit 76c4e83

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/models/group.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Group < ActiveRecord::Base
2323
delegate :name, to: :owner, allow_nil: true, prefix: true
2424

2525
def self.search query
26-
where("name like :query OR code like :query", query: "%#{query}%")
26+
where("name LIKE :query OR code LIKE :query", query: "%#{query}%")
2727
end
2828

2929
def to_param

app/models/project.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def self.active
3838
end
3939

4040
def self.search query
41-
where("name like :query OR code like :query OR path like :query", query: "%#{query}%")
41+
where("name LIKE :query OR code LIKE :query OR path LIKE :query", query: "%#{query}%")
4242
end
4343

4444
def self.create_by_user(params, user)
@@ -127,7 +127,7 @@ def commit_notes(commit)
127127
end
128128

129129
def commit_line_notes(commit)
130-
notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null")
130+
notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
131131
end
132132

133133
def public?

app/models/user.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def self.gitlab_auth
7373
end
7474

7575
def self.search query
76-
where("name like :query or email like :query", query: "%#{query}%")
76+
where("name LIKE :query OR email LIKE :query", query: "%#{query}%")
7777
end
7878
end
7979

app/roles/issue_commonality.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module IssueCommonality
1919
scope :opened, where(closed: false)
2020
scope :closed, where(closed: true)
2121
scope :of_group, ->(group) { where(project_id: group.project_ids) }
22-
scope :assigned, lambda { |u| where(assignee_id: u.id)}
22+
scope :assigned, ->(u) { where(assignee_id: u.id)}
2323

2424
delegate :name,
2525
:email,

0 commit comments

Comments
 (0)