diff options
author | Valeriy Sizov <vsv2711@gmail.com> | 2012-10-04 13:40:40 +0300 |
---|---|---|
committer | Valeriy Sizov <vsv2711@gmail.com> | 2012-10-04 13:40:40 +0300 |
commit | 76c4e831932bff2273c38abe1ff37cdb79164c90 (patch) | |
tree | 3c9cb4a6582d12744377386d23966b3f76896017 | |
parent | 810d0903f8b8639a6429483a290cbf0fe5a67776 (diff) | |
download | gitlab-ce-76c4e831932bff2273c38abe1ff37cdb79164c90.tar.gz |
Minore code-style fixes
-rw-r--r-- | app/models/group.rb | 2 | ||||
-rw-r--r-- | app/models/project.rb | 4 | ||||
-rw-r--r-- | app/models/user.rb | 2 | ||||
-rw-r--r-- | app/roles/issue_commonality.rb | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/app/models/group.rb b/app/models/group.rb index 628d00092cd..780d5fddca0 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -23,7 +23,7 @@ class Group < ActiveRecord::Base delegate :name, to: :owner, allow_nil: true, prefix: true 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 def to_param diff --git a/app/models/project.rb b/app/models/project.rb index c00bb4563fd..982b746365d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -38,7 +38,7 @@ class Project < ActiveRecord::Base end 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 def self.create_by_user(params, user) @@ -127,7 +127,7 @@ class Project < ActiveRecord::Base end 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 def public? diff --git a/app/models/user.rb b/app/models/user.rb index bed568effdc..cf12fd60708 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -73,7 +73,7 @@ class User < ActiveRecord::Base end 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 diff --git a/app/roles/issue_commonality.rb b/app/roles/issue_commonality.rb index ab6f89ff0b8..304f08fda6c 100644 --- a/app/roles/issue_commonality.rb +++ b/app/roles/issue_commonality.rb @@ -19,7 +19,7 @@ module IssueCommonality scope :opened, where(closed: false) scope :closed, where(closed: true) 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, :email, |