Skip to content
代码片段 群组 项目
提交 76c4e831 编辑于 作者: Valeriy Sizov's avatar Valeriy Sizov
浏览文件

Minore code-style fixes

上级 810d0903
No related branches found
No related tags found
无相关合并请求
...@@ -23,7 +23,7 @@ class Group < ActiveRecord::Base ...@@ -23,7 +23,7 @@ class Group < ActiveRecord::Base
delegate :name, to: :owner, allow_nil: true, prefix: true delegate :name, to: :owner, allow_nil: true, prefix: true
def self.search query def self.search query
where("name like :query OR code like :query", query: "%#{query}%") where("name LIKE :query OR code LIKE :query", query: "%#{query}%")
end end
def to_param def to_param
......
...@@ -38,7 +38,7 @@ def self.active ...@@ -38,7 +38,7 @@ def self.active
end end
def self.search query def self.search query
where("name like :query OR code like :query OR path like :query", query: "%#{query}%") where("name LIKE :query OR code LIKE :query OR path LIKE :query", query: "%#{query}%")
end end
def self.create_by_user(params, user) def self.create_by_user(params, user)
...@@ -127,7 +127,7 @@ def commit_notes(commit) ...@@ -127,7 +127,7 @@ def commit_notes(commit)
end end
def commit_line_notes(commit) def commit_line_notes(commit)
notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code is not null") notes.where(noteable_id: commit.id, noteable_type: "Commit").where("line_code IS NOT NULL")
end end
def public? def public?
......
...@@ -73,7 +73,7 @@ def self.gitlab_auth ...@@ -73,7 +73,7 @@ def self.gitlab_auth
end end
def self.search query def self.search query
where("name like :query or email like :query", query: "%#{query}%") where("name LIKE :query OR email LIKE :query", query: "%#{query}%")
end end
end end
......
...@@ -19,7 +19,7 @@ module IssueCommonality ...@@ -19,7 +19,7 @@ module IssueCommonality
scope :opened, where(closed: false) scope :opened, where(closed: false)
scope :closed, where(closed: true) scope :closed, where(closed: true)
scope :of_group, ->(group) { where(project_id: group.project_ids) } scope :of_group, ->(group) { where(project_id: group.project_ids) }
scope :assigned, lambda { |u| where(assignee_id: u.id)} scope :assigned, ->(u) { where(assignee_id: u.id)}
delegate :name, delegate :name,
:email, :email,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册